azure-quantum 3.5.1.dev1__py3-none-any.whl → 3.6.1__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.
- azure/quantum/_client/__init__.py +2 -2
- azure/quantum/_client/_client.py +18 -57
- azure/quantum/_client/_configuration.py +13 -22
- azure/quantum/_client/_patch.py +7 -6
- azure/quantum/_client/_utils/__init__.py +6 -0
- azure/quantum/_client/{_model_base.py → _utils/model_base.py} +210 -45
- azure/quantum/_client/{_serialization.py → _utils/serialization.py} +74 -151
- azure/quantum/_client/_validation.py +66 -0
- azure/quantum/_client/_version.py +1 -1
- azure/quantum/_client/aio/__init__.py +29 -0
- azure/quantum/_client/aio/_client.py +110 -0
- azure/quantum/_client/aio/_configuration.py +75 -0
- azure/quantum/_client/aio/_patch.py +21 -0
- azure/quantum/_client/aio/operations/__init__.py +25 -0
- azure/quantum/_client/aio/operations/_operations.py +1988 -0
- azure/quantum/_client/aio/operations/_patch.py +21 -0
- azure/quantum/_client/models/__init__.py +8 -4
- azure/quantum/_client/models/_enums.py +28 -23
- azure/quantum/_client/models/_models.py +198 -106
- azure/quantum/_client/models/_patch.py +7 -6
- azure/quantum/_client/operations/__init__.py +2 -12
- azure/quantum/_client/operations/_operations.py +900 -715
- azure/quantum/_client/operations/_patch.py +7 -6
- azure/quantum/_constants.py +6 -1
- azure/quantum/_mgmt_client.py +19 -9
- azure/quantum/_workspace_connection_params.py +27 -2
- azure/quantum/job/base_job.py +8 -0
- azure/quantum/job/job.py +13 -4
- azure/quantum/job/session.py +11 -0
- azure/quantum/target/rigetti/target.py +1 -6
- azure/quantum/target/target.py +5 -1
- azure/quantum/target/target_factory.py +14 -7
- azure/quantum/version.py +1 -1
- azure/quantum/workspace.py +35 -31
- {azure_quantum-3.5.1.dev1.dist-info → azure_quantum-3.6.1.dist-info}/METADATA +2 -6
- azure_quantum-3.6.1.dist-info/RECORD +74 -0
- {azure_quantum-3.5.1.dev1.dist-info → azure_quantum-3.6.1.dist-info}/WHEEL +1 -1
- azure_quantum-3.5.1.dev1.dist-info/RECORD +0 -65
- {azure_quantum-3.5.1.dev1.dist-info → azure_quantum-3.6.1.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# pylint: disable=too-many-lines
|
|
1
|
+
# pylint: disable=line-too-long,useless-suppression,too-many-lines
|
|
2
2
|
# coding=utf-8
|
|
3
3
|
# --------------------------------------------------------------------------
|
|
4
4
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
# Code generated by Microsoft (R) Python Code Generator.
|
|
7
7
|
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
8
8
|
# --------------------------------------------------------------------------
|
|
9
|
+
from collections.abc import MutableMapping
|
|
9
10
|
from io import IOBase
|
|
10
11
|
import json
|
|
11
|
-
import
|
|
12
|
-
from typing import Any, Callable, Dict, IO, Iterable, List, Optional, TypeVar, Union, overload
|
|
12
|
+
from typing import Any, Callable, IO, Optional, TypeVar, Union, overload
|
|
13
13
|
import urllib.parse
|
|
14
14
|
|
|
15
|
+
from azure.core import PipelineClient
|
|
15
16
|
from azure.core.exceptions import (
|
|
16
17
|
ClientAuthenticationError,
|
|
17
18
|
HttpResponseError,
|
|
@@ -29,33 +30,75 @@ from azure.core.tracing.decorator import distributed_trace
|
|
|
29
30
|
from azure.core.utils import case_insensitive_dict
|
|
30
31
|
|
|
31
32
|
from .. import models as _models
|
|
32
|
-
from ..
|
|
33
|
-
from ..
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
else:
|
|
38
|
-
from typing import MutableMapping # type: ignore
|
|
39
|
-
JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object
|
|
33
|
+
from .._configuration import WorkspaceClientConfiguration
|
|
34
|
+
from .._utils.model_base import SdkJSONEncoder, _deserialize
|
|
35
|
+
from .._utils.serialization import Deserializer, Serializer
|
|
36
|
+
from .._validation import api_version_validation
|
|
37
|
+
|
|
40
38
|
T = TypeVar("T")
|
|
41
|
-
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T,
|
|
39
|
+
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]]
|
|
40
|
+
JSON = MutableMapping[str, Any]
|
|
42
41
|
|
|
43
42
|
_SERIALIZER = Serializer()
|
|
44
43
|
_SERIALIZER.client_side_validation = False
|
|
45
44
|
|
|
46
45
|
|
|
47
|
-
def
|
|
46
|
+
def build_services_top_level_items_listv2_request( # pylint: disable=name-too-long
|
|
47
|
+
subscription_id: str,
|
|
48
|
+
resource_group_name: str,
|
|
49
|
+
workspace_name: str,
|
|
50
|
+
*,
|
|
51
|
+
filter: Optional[str] = None,
|
|
52
|
+
skip: Optional[int] = None,
|
|
53
|
+
top: Optional[int] = None,
|
|
54
|
+
orderby: Optional[str] = None,
|
|
55
|
+
**kwargs: Any
|
|
56
|
+
) -> HttpRequest:
|
|
57
|
+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
58
|
+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
59
|
+
|
|
60
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
61
|
+
accept = _headers.pop("Accept", "application/json")
|
|
62
|
+
|
|
63
|
+
# Construct URL
|
|
64
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/topLevelItems"
|
|
65
|
+
path_format_arguments = {
|
|
66
|
+
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
67
|
+
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
68
|
+
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
72
|
+
|
|
73
|
+
# Construct parameters
|
|
74
|
+
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
75
|
+
if filter is not None:
|
|
76
|
+
_params["filter"] = _SERIALIZER.query("filter", filter, "str")
|
|
77
|
+
if skip is not None:
|
|
78
|
+
_params["skip"] = _SERIALIZER.query("skip", skip, "int")
|
|
79
|
+
if top is not None:
|
|
80
|
+
_params["top"] = _SERIALIZER.query("top", top, "int")
|
|
81
|
+
if orderby is not None:
|
|
82
|
+
_params["orderby"] = _SERIALIZER.query("orderby", orderby, "str")
|
|
83
|
+
|
|
84
|
+
# Construct headers
|
|
85
|
+
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
86
|
+
|
|
87
|
+
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def build_services_jobs_create_request(
|
|
48
91
|
subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
49
92
|
) -> HttpRequest:
|
|
50
93
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
51
94
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
52
95
|
|
|
53
96
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
54
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
97
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
55
98
|
accept = _headers.pop("Accept", "application/json")
|
|
56
99
|
|
|
57
100
|
# Construct URL
|
|
58
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}"
|
|
101
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}"
|
|
59
102
|
path_format_arguments = {
|
|
60
103
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
61
104
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -76,18 +119,18 @@ def build_jobs_create_or_replace_request(
|
|
|
76
119
|
return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
|
|
77
120
|
|
|
78
121
|
|
|
79
|
-
def
|
|
122
|
+
def build_services_jobs_update_request(
|
|
80
123
|
subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
81
124
|
) -> HttpRequest:
|
|
82
125
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
83
126
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
84
127
|
|
|
85
128
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
86
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
129
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
87
130
|
accept = _headers.pop("Accept", "application/json")
|
|
88
131
|
|
|
89
132
|
# Construct URL
|
|
90
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/
|
|
133
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobUpdateOptions/{jobId}"
|
|
91
134
|
path_format_arguments = {
|
|
92
135
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
93
136
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -108,17 +151,40 @@ def build_jobs_update_request(
|
|
|
108
151
|
return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)
|
|
109
152
|
|
|
110
153
|
|
|
111
|
-
def
|
|
154
|
+
def build_services_jobs_delete_request(
|
|
155
|
+
subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
156
|
+
) -> HttpRequest:
|
|
157
|
+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
158
|
+
|
|
159
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
160
|
+
# Construct URL
|
|
161
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}"
|
|
162
|
+
path_format_arguments = {
|
|
163
|
+
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
164
|
+
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
165
|
+
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
166
|
+
"jobId": _SERIALIZER.url("job_id", job_id, "str"),
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
170
|
+
|
|
171
|
+
# Construct parameters
|
|
172
|
+
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
173
|
+
|
|
174
|
+
return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def build_services_jobs_cancel_request(
|
|
112
178
|
subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
113
179
|
) -> HttpRequest:
|
|
114
180
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
115
181
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
116
182
|
|
|
117
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
183
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
118
184
|
accept = _headers.pop("Accept", "application/json")
|
|
119
185
|
|
|
120
186
|
# Construct URL
|
|
121
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}"
|
|
187
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}:cancel"
|
|
122
188
|
path_format_arguments = {
|
|
123
189
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
124
190
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -134,20 +200,20 @@ def build_jobs_delete_request(
|
|
|
134
200
|
# Construct headers
|
|
135
201
|
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
136
202
|
|
|
137
|
-
return HttpRequest(method="
|
|
203
|
+
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
|
|
138
204
|
|
|
139
205
|
|
|
140
|
-
def
|
|
206
|
+
def build_services_jobs_get_request(
|
|
141
207
|
subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
142
208
|
) -> HttpRequest:
|
|
143
209
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
144
210
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
145
211
|
|
|
146
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
212
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
147
213
|
accept = _headers.pop("Accept", "application/json")
|
|
148
214
|
|
|
149
215
|
# Construct URL
|
|
150
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}"
|
|
216
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs/{jobId}"
|
|
151
217
|
path_format_arguments = {
|
|
152
218
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
153
219
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -166,7 +232,7 @@ def build_jobs_get_request(
|
|
|
166
232
|
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
167
233
|
|
|
168
234
|
|
|
169
|
-
def
|
|
235
|
+
def build_services_jobs_list_request(
|
|
170
236
|
subscription_id: str,
|
|
171
237
|
resource_group_name: str,
|
|
172
238
|
workspace_name: str,
|
|
@@ -180,11 +246,11 @@ def build_jobs_list_request(
|
|
|
180
246
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
181
247
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
182
248
|
|
|
183
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
249
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
184
250
|
accept = _headers.pop("Accept", "application/json")
|
|
185
251
|
|
|
186
252
|
# Construct URL
|
|
187
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs"
|
|
253
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/jobs"
|
|
188
254
|
path_format_arguments = {
|
|
189
255
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
190
256
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -210,18 +276,74 @@ def build_jobs_list_request(
|
|
|
210
276
|
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
211
277
|
|
|
212
278
|
|
|
213
|
-
def
|
|
279
|
+
def build_services_providers_list_request(
|
|
280
|
+
subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
281
|
+
) -> HttpRequest:
|
|
282
|
+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
283
|
+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
284
|
+
|
|
285
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
286
|
+
accept = _headers.pop("Accept", "application/json")
|
|
287
|
+
|
|
288
|
+
# Construct URL
|
|
289
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/providerStatus"
|
|
290
|
+
path_format_arguments = {
|
|
291
|
+
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
292
|
+
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
293
|
+
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
297
|
+
|
|
298
|
+
# Construct parameters
|
|
299
|
+
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
300
|
+
|
|
301
|
+
# Construct headers
|
|
302
|
+
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
303
|
+
|
|
304
|
+
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def build_services_quotas_list_request(
|
|
308
|
+
subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
309
|
+
) -> HttpRequest:
|
|
310
|
+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
311
|
+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
312
|
+
|
|
313
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
314
|
+
accept = _headers.pop("Accept", "application/json")
|
|
315
|
+
|
|
316
|
+
# Construct URL
|
|
317
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/quotas"
|
|
318
|
+
path_format_arguments = {
|
|
319
|
+
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
320
|
+
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
321
|
+
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
325
|
+
|
|
326
|
+
# Construct parameters
|
|
327
|
+
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
328
|
+
|
|
329
|
+
# Construct headers
|
|
330
|
+
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
331
|
+
|
|
332
|
+
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
def build_services_sessions_open_request(
|
|
214
336
|
subscription_id: str, resource_group_name: str, workspace_name: str, session_id: str, **kwargs: Any
|
|
215
337
|
) -> HttpRequest:
|
|
216
338
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
217
339
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
218
340
|
|
|
219
341
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
220
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
342
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
221
343
|
accept = _headers.pop("Accept", "application/json")
|
|
222
344
|
|
|
223
345
|
# Construct URL
|
|
224
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}"
|
|
346
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}"
|
|
225
347
|
path_format_arguments = {
|
|
226
348
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
227
349
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -242,17 +364,17 @@ def build_sessions_create_or_replace_request(
|
|
|
242
364
|
return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs)
|
|
243
365
|
|
|
244
366
|
|
|
245
|
-
def
|
|
367
|
+
def build_services_sessions_close_request(
|
|
246
368
|
subscription_id: str, resource_group_name: str, workspace_name: str, session_id: str, **kwargs: Any
|
|
247
369
|
) -> HttpRequest:
|
|
248
370
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
249
371
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
250
372
|
|
|
251
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
373
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
252
374
|
accept = _headers.pop("Accept", "application/json")
|
|
253
375
|
|
|
254
376
|
# Construct URL
|
|
255
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}:close"
|
|
377
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}:close"
|
|
256
378
|
path_format_arguments = {
|
|
257
379
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
258
380
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -271,17 +393,17 @@ def build_sessions_close_request(
|
|
|
271
393
|
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
|
|
272
394
|
|
|
273
395
|
|
|
274
|
-
def
|
|
396
|
+
def build_services_sessions_get_request(
|
|
275
397
|
subscription_id: str, resource_group_name: str, workspace_name: str, session_id: str, **kwargs: Any
|
|
276
398
|
) -> HttpRequest:
|
|
277
399
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
278
400
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
279
401
|
|
|
280
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
402
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
281
403
|
accept = _headers.pop("Accept", "application/json")
|
|
282
404
|
|
|
283
405
|
# Construct URL
|
|
284
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}"
|
|
406
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}"
|
|
285
407
|
path_format_arguments = {
|
|
286
408
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
287
409
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -300,7 +422,7 @@ def build_sessions_get_request(
|
|
|
300
422
|
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
301
423
|
|
|
302
424
|
|
|
303
|
-
def
|
|
425
|
+
def build_services_sessions_listv2_request(
|
|
304
426
|
subscription_id: str,
|
|
305
427
|
resource_group_name: str,
|
|
306
428
|
workspace_name: str,
|
|
@@ -314,11 +436,11 @@ def build_sessions_list_request(
|
|
|
314
436
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
315
437
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
316
438
|
|
|
317
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
439
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
318
440
|
accept = _headers.pop("Accept", "application/json")
|
|
319
441
|
|
|
320
442
|
# Construct URL
|
|
321
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions"
|
|
443
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions"
|
|
322
444
|
path_format_arguments = {
|
|
323
445
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
324
446
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -344,7 +466,7 @@ def build_sessions_list_request(
|
|
|
344
466
|
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
345
467
|
|
|
346
468
|
|
|
347
|
-
def
|
|
469
|
+
def build_services_sessions_jobs_list_request( # pylint: disable=name-too-long
|
|
348
470
|
subscription_id: str,
|
|
349
471
|
resource_group_name: str,
|
|
350
472
|
workspace_name: str,
|
|
@@ -359,11 +481,11 @@ def build_sessions_jobs_list_request(
|
|
|
359
481
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
360
482
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
361
483
|
|
|
362
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
484
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
363
485
|
accept = _headers.pop("Accept", "application/json")
|
|
364
486
|
|
|
365
487
|
# Construct URL
|
|
366
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}/jobs"
|
|
488
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/sessions/{sessionId}/jobs"
|
|
367
489
|
path_format_arguments = {
|
|
368
490
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
369
491
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -390,46 +512,18 @@ def build_sessions_jobs_list_request(
|
|
|
390
512
|
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
391
513
|
|
|
392
514
|
|
|
393
|
-
def
|
|
394
|
-
subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
395
|
-
) -> HttpRequest:
|
|
396
|
-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
397
|
-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
398
|
-
|
|
399
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview"))
|
|
400
|
-
accept = _headers.pop("Accept", "application/json")
|
|
401
|
-
|
|
402
|
-
# Construct URL
|
|
403
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/providerStatus" # pylint: disable=line-too-long
|
|
404
|
-
path_format_arguments = {
|
|
405
|
-
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
406
|
-
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
407
|
-
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
411
|
-
|
|
412
|
-
# Construct parameters
|
|
413
|
-
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
414
|
-
|
|
415
|
-
# Construct headers
|
|
416
|
-
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
417
|
-
|
|
418
|
-
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
def build_storage_get_sas_uri_request(
|
|
515
|
+
def build_services_storage_get_sas_uri_request( # pylint: disable=name-too-long
|
|
422
516
|
subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
423
517
|
) -> HttpRequest:
|
|
424
518
|
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
425
519
|
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
426
520
|
|
|
427
521
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
428
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "
|
|
522
|
+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-12-01-preview"))
|
|
429
523
|
accept = _headers.pop("Accept", "application/json")
|
|
430
524
|
|
|
431
525
|
# Construct URL
|
|
432
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/storage/sasUri"
|
|
526
|
+
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/storage/sasUri"
|
|
433
527
|
path_format_arguments = {
|
|
434
528
|
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
435
529
|
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
@@ -449,108 +543,81 @@ def build_storage_get_sas_uri_request(
|
|
|
449
543
|
return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs)
|
|
450
544
|
|
|
451
545
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
457
|
-
|
|
458
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview"))
|
|
459
|
-
accept = _headers.pop("Accept", "application/json")
|
|
460
|
-
|
|
461
|
-
# Construct URL
|
|
462
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/quotas" # pylint: disable=line-too-long
|
|
463
|
-
path_format_arguments = {
|
|
464
|
-
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
465
|
-
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
466
|
-
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
470
|
-
|
|
471
|
-
# Construct parameters
|
|
472
|
-
_params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")
|
|
473
|
-
|
|
474
|
-
# Construct headers
|
|
475
|
-
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
476
|
-
|
|
477
|
-
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
def build_top_level_items_list_request(
|
|
481
|
-
subscription_id: str,
|
|
482
|
-
resource_group_name: str,
|
|
483
|
-
workspace_name: str,
|
|
484
|
-
*,
|
|
485
|
-
filter: Optional[str] = None,
|
|
486
|
-
skip: Optional[int] = None,
|
|
487
|
-
top: Optional[int] = None,
|
|
488
|
-
orderby: Optional[str] = None,
|
|
489
|
-
**kwargs: Any
|
|
490
|
-
) -> HttpRequest:
|
|
491
|
-
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
492
|
-
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
|
493
|
-
|
|
494
|
-
api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-10-01-preview"))
|
|
495
|
-
accept = _headers.pop("Accept", "application/json")
|
|
496
|
-
|
|
497
|
-
# Construct URL
|
|
498
|
-
_url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Quantum/workspaces/{workspaceName}/topLevelItems" # pylint: disable=line-too-long
|
|
499
|
-
path_format_arguments = {
|
|
500
|
-
"subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"),
|
|
501
|
-
"resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"),
|
|
502
|
-
"workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
546
|
+
class ServicesOperations:
|
|
547
|
+
"""
|
|
548
|
+
.. warning::
|
|
549
|
+
**DO NOT** instantiate this class directly.
|
|
506
550
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if skip is not None:
|
|
512
|
-
_params["skip"] = _SERIALIZER.query("skip", skip, "int")
|
|
513
|
-
if top is not None:
|
|
514
|
-
_params["top"] = _SERIALIZER.query("top", top, "int")
|
|
515
|
-
if orderby is not None:
|
|
516
|
-
_params["orderby"] = _SERIALIZER.query("orderby", orderby, "str")
|
|
551
|
+
Instead, you should access the following operations through
|
|
552
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
553
|
+
:attr:`services` attribute.
|
|
554
|
+
"""
|
|
517
555
|
|
|
518
|
-
|
|
519
|
-
|
|
556
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
557
|
+
input_args = list(args)
|
|
558
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
559
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
560
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
561
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
520
562
|
|
|
521
|
-
|
|
563
|
+
self.top_level_items = ServicesTopLevelItemsOperations(
|
|
564
|
+
self._client, self._config, self._serialize, self._deserialize
|
|
565
|
+
)
|
|
566
|
+
self.jobs = ServicesJobsOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
567
|
+
self.providers = ServicesProvidersOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
568
|
+
self.quotas = ServicesQuotasOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
569
|
+
self.sessions = ServicesSessionsOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
570
|
+
self.storage = ServicesStorageOperations(self._client, self._config, self._serialize, self._deserialize)
|
|
522
571
|
|
|
523
572
|
|
|
524
|
-
class
|
|
573
|
+
class ServicesTopLevelItemsOperations:
|
|
525
574
|
"""
|
|
526
575
|
.. warning::
|
|
527
576
|
**DO NOT** instantiate this class directly.
|
|
528
577
|
|
|
529
578
|
Instead, you should access the following operations through
|
|
530
|
-
:class:`~azure.quantum.
|
|
531
|
-
:attr:`
|
|
579
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
580
|
+
:attr:`top_level_items` attribute.
|
|
532
581
|
"""
|
|
533
582
|
|
|
534
|
-
def __init__(self, *args, **kwargs):
|
|
583
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
535
584
|
input_args = list(args)
|
|
536
|
-
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
537
|
-
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
538
|
-
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
539
|
-
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
585
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
586
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
587
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
588
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
540
589
|
|
|
541
|
-
@
|
|
542
|
-
|
|
590
|
+
@distributed_trace
|
|
591
|
+
@api_version_validation(
|
|
592
|
+
method_added_on="2024-10-01-preview",
|
|
593
|
+
params_added_on={
|
|
594
|
+
"2024-10-01-preview": [
|
|
595
|
+
"api_version",
|
|
596
|
+
"subscription_id",
|
|
597
|
+
"resource_group_name",
|
|
598
|
+
"workspace_name",
|
|
599
|
+
"filter",
|
|
600
|
+
"skip",
|
|
601
|
+
"top",
|
|
602
|
+
"orderby",
|
|
603
|
+
"accept",
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
api_versions_list=["2024-10-01-preview", "2025-09-01-preview", "2025-12-01-preview"],
|
|
607
|
+
)
|
|
608
|
+
def listv2(
|
|
543
609
|
self,
|
|
544
610
|
subscription_id: str,
|
|
545
611
|
resource_group_name: str,
|
|
546
612
|
workspace_name: str,
|
|
547
|
-
job_id: str,
|
|
548
|
-
resource: _models.JobDetails,
|
|
549
613
|
*,
|
|
550
|
-
|
|
614
|
+
filter: Optional[str] = None,
|
|
615
|
+
skip: Optional[int] = None,
|
|
616
|
+
top: Optional[int] = None,
|
|
617
|
+
orderby: Optional[str] = None,
|
|
551
618
|
**kwargs: Any
|
|
552
|
-
) -> _models.
|
|
553
|
-
"""
|
|
619
|
+
) -> ItemPaged["_models.ItemDetails"]:
|
|
620
|
+
"""List top-level items.
|
|
554
621
|
|
|
555
622
|
:param subscription_id: The Azure subscription ID. Required.
|
|
556
623
|
:type subscription_id: str
|
|
@@ -558,36 +625,167 @@ class JobsOperations:
|
|
|
558
625
|
:type resource_group_name: str
|
|
559
626
|
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
560
627
|
:type workspace_name: str
|
|
561
|
-
:
|
|
562
|
-
:
|
|
563
|
-
:
|
|
564
|
-
:
|
|
565
|
-
:keyword
|
|
566
|
-
|
|
567
|
-
:
|
|
568
|
-
:
|
|
569
|
-
:
|
|
628
|
+
:keyword filter: Filter the result list using the given expression. Default value is None.
|
|
629
|
+
:paramtype filter: str
|
|
630
|
+
:keyword skip: The number of result items to skip. Default value is None.
|
|
631
|
+
:paramtype skip: int
|
|
632
|
+
:keyword top: The number of jobs taken. Default value is None.
|
|
633
|
+
:paramtype top: int
|
|
634
|
+
:keyword orderby: The order of returned items. Default value is None.
|
|
635
|
+
:paramtype orderby: str
|
|
636
|
+
:return: An iterator like instance of ItemDetails
|
|
637
|
+
:rtype: ~azure.core.paging.ItemPaged[~azure.quantum.models.ItemDetails]
|
|
570
638
|
:raises ~azure.core.exceptions.HttpResponseError:
|
|
571
639
|
"""
|
|
640
|
+
_headers = kwargs.pop("headers", {}) or {}
|
|
641
|
+
_params = kwargs.pop("params", {}) or {}
|
|
572
642
|
|
|
573
|
-
|
|
574
|
-
def create_or_replace(
|
|
575
|
-
self,
|
|
576
|
-
subscription_id: str,
|
|
577
|
-
resource_group_name: str,
|
|
578
|
-
workspace_name: str,
|
|
579
|
-
job_id: str,
|
|
580
|
-
resource: JSON,
|
|
581
|
-
*,
|
|
582
|
-
content_type: str = "application/json",
|
|
583
|
-
**kwargs: Any
|
|
584
|
-
) -> _models.JobDetails:
|
|
585
|
-
"""Create a new job.
|
|
643
|
+
cls: ClsType[list[_models.ItemDetails]] = kwargs.pop("cls", None)
|
|
586
644
|
|
|
587
|
-
:
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
645
|
+
error_map: MutableMapping = {
|
|
646
|
+
401: ClientAuthenticationError,
|
|
647
|
+
404: ResourceNotFoundError,
|
|
648
|
+
409: ResourceExistsError,
|
|
649
|
+
304: ResourceNotModifiedError,
|
|
650
|
+
}
|
|
651
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
652
|
+
|
|
653
|
+
def prepare_request(next_link=None):
|
|
654
|
+
if not next_link:
|
|
655
|
+
|
|
656
|
+
_request = build_services_top_level_items_listv2_request(
|
|
657
|
+
subscription_id=subscription_id,
|
|
658
|
+
resource_group_name=resource_group_name,
|
|
659
|
+
workspace_name=workspace_name,
|
|
660
|
+
filter=filter,
|
|
661
|
+
skip=skip,
|
|
662
|
+
top=top,
|
|
663
|
+
orderby=orderby,
|
|
664
|
+
api_version=self._config.api_version,
|
|
665
|
+
headers=_headers,
|
|
666
|
+
params=_params,
|
|
667
|
+
)
|
|
668
|
+
path_format_arguments = {
|
|
669
|
+
"endpoint": self._serialize.url(
|
|
670
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
671
|
+
),
|
|
672
|
+
}
|
|
673
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
674
|
+
|
|
675
|
+
else:
|
|
676
|
+
# make call to next link with the client's api-version
|
|
677
|
+
_parsed_next_link = urllib.parse.urlparse(next_link)
|
|
678
|
+
_next_request_params = case_insensitive_dict(
|
|
679
|
+
{
|
|
680
|
+
key: [urllib.parse.quote(v) for v in value]
|
|
681
|
+
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
|
682
|
+
}
|
|
683
|
+
)
|
|
684
|
+
_next_request_params["api-version"] = self._config.api_version
|
|
685
|
+
_request = HttpRequest(
|
|
686
|
+
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
687
|
+
)
|
|
688
|
+
path_format_arguments = {
|
|
689
|
+
"endpoint": self._serialize.url(
|
|
690
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
691
|
+
),
|
|
692
|
+
}
|
|
693
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
694
|
+
|
|
695
|
+
return _request
|
|
696
|
+
|
|
697
|
+
def extract_data(pipeline_response):
|
|
698
|
+
deserialized = pipeline_response.http_response.json()
|
|
699
|
+
list_of_elem = _deserialize(list[_models.ItemDetails], deserialized.get("value", []))
|
|
700
|
+
if cls:
|
|
701
|
+
list_of_elem = cls(list_of_elem) # type: ignore
|
|
702
|
+
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
703
|
+
|
|
704
|
+
def get_next(next_link=None):
|
|
705
|
+
_request = prepare_request(next_link)
|
|
706
|
+
|
|
707
|
+
_stream = False
|
|
708
|
+
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
709
|
+
_request, stream=_stream, **kwargs
|
|
710
|
+
)
|
|
711
|
+
response = pipeline_response.http_response
|
|
712
|
+
|
|
713
|
+
if response.status_code not in [200]:
|
|
714
|
+
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
715
|
+
raise HttpResponseError(response=response)
|
|
716
|
+
|
|
717
|
+
return pipeline_response
|
|
718
|
+
|
|
719
|
+
return ItemPaged(get_next, extract_data)
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
class ServicesJobsOperations:
|
|
723
|
+
"""
|
|
724
|
+
.. warning::
|
|
725
|
+
**DO NOT** instantiate this class directly.
|
|
726
|
+
|
|
727
|
+
Instead, you should access the following operations through
|
|
728
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
729
|
+
:attr:`jobs` attribute.
|
|
730
|
+
"""
|
|
731
|
+
|
|
732
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
733
|
+
input_args = list(args)
|
|
734
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
735
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
736
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
737
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
738
|
+
|
|
739
|
+
@overload
|
|
740
|
+
def create(
|
|
741
|
+
self,
|
|
742
|
+
subscription_id: str,
|
|
743
|
+
resource_group_name: str,
|
|
744
|
+
workspace_name: str,
|
|
745
|
+
job_id: str,
|
|
746
|
+
resource: _models.JobDetails,
|
|
747
|
+
*,
|
|
748
|
+
content_type: str = "application/json",
|
|
749
|
+
**kwargs: Any
|
|
750
|
+
) -> _models.JobDetails:
|
|
751
|
+
"""Create a new job.
|
|
752
|
+
|
|
753
|
+
:param subscription_id: The Azure subscription ID. Required.
|
|
754
|
+
:type subscription_id: str
|
|
755
|
+
:param resource_group_name: Name of the Azure resource group. Required.
|
|
756
|
+
:type resource_group_name: str
|
|
757
|
+
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
758
|
+
:type workspace_name: str
|
|
759
|
+
:param job_id: Id of the job. Required.
|
|
760
|
+
:type job_id: str
|
|
761
|
+
:param resource: The resource instance. Required.
|
|
762
|
+
:type resource: ~azure.quantum.models.JobDetails
|
|
763
|
+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
|
764
|
+
Default value is "application/json".
|
|
765
|
+
:paramtype content_type: str
|
|
766
|
+
:return: JobDetails. The JobDetails is compatible with MutableMapping
|
|
767
|
+
:rtype: ~azure.quantum.models.JobDetails
|
|
768
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
769
|
+
"""
|
|
770
|
+
|
|
771
|
+
@overload
|
|
772
|
+
def create(
|
|
773
|
+
self,
|
|
774
|
+
subscription_id: str,
|
|
775
|
+
resource_group_name: str,
|
|
776
|
+
workspace_name: str,
|
|
777
|
+
job_id: str,
|
|
778
|
+
resource: JSON,
|
|
779
|
+
*,
|
|
780
|
+
content_type: str = "application/json",
|
|
781
|
+
**kwargs: Any
|
|
782
|
+
) -> _models.JobDetails:
|
|
783
|
+
"""Create a new job.
|
|
784
|
+
|
|
785
|
+
:param subscription_id: The Azure subscription ID. Required.
|
|
786
|
+
:type subscription_id: str
|
|
787
|
+
:param resource_group_name: Name of the Azure resource group. Required.
|
|
788
|
+
:type resource_group_name: str
|
|
591
789
|
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
592
790
|
:type workspace_name: str
|
|
593
791
|
:param job_id: Id of the job. Required.
|
|
@@ -603,7 +801,7 @@ class JobsOperations:
|
|
|
603
801
|
"""
|
|
604
802
|
|
|
605
803
|
@overload
|
|
606
|
-
def
|
|
804
|
+
def create(
|
|
607
805
|
self,
|
|
608
806
|
subscription_id: str,
|
|
609
807
|
resource_group_name: str,
|
|
@@ -635,7 +833,7 @@ class JobsOperations:
|
|
|
635
833
|
"""
|
|
636
834
|
|
|
637
835
|
@distributed_trace
|
|
638
|
-
def
|
|
836
|
+
def create(
|
|
639
837
|
self,
|
|
640
838
|
subscription_id: str,
|
|
641
839
|
resource_group_name: str,
|
|
@@ -682,7 +880,7 @@ class JobsOperations:
|
|
|
682
880
|
else:
|
|
683
881
|
_content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
|
|
684
882
|
|
|
685
|
-
_request =
|
|
883
|
+
_request = build_services_jobs_create_request(
|
|
686
884
|
subscription_id=subscription_id,
|
|
687
885
|
resource_group_name=resource_group_name,
|
|
688
886
|
workspace_name=workspace_name,
|
|
@@ -694,10 +892,7 @@ class JobsOperations:
|
|
|
694
892
|
params=_params,
|
|
695
893
|
)
|
|
696
894
|
path_format_arguments = {
|
|
697
|
-
"
|
|
698
|
-
"serviceBaseUrl": self._serialize.url(
|
|
699
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
700
|
-
),
|
|
895
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
701
896
|
}
|
|
702
897
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
703
898
|
|
|
@@ -734,11 +929,43 @@ class JobsOperations:
|
|
|
734
929
|
resource_group_name: str,
|
|
735
930
|
workspace_name: str,
|
|
736
931
|
job_id: str,
|
|
737
|
-
resource:
|
|
932
|
+
resource: _models.JobUpdateOptions,
|
|
933
|
+
*,
|
|
934
|
+
content_type: str = "application/merge-patch+json",
|
|
935
|
+
**kwargs: Any
|
|
936
|
+
) -> _models.JobUpdateOptions:
|
|
937
|
+
"""Update job properties.
|
|
938
|
+
|
|
939
|
+
:param subscription_id: The Azure subscription ID. Required.
|
|
940
|
+
:type subscription_id: str
|
|
941
|
+
:param resource_group_name: Name of the Azure resource group. Required.
|
|
942
|
+
:type resource_group_name: str
|
|
943
|
+
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
944
|
+
:type workspace_name: str
|
|
945
|
+
:param job_id: Id of the job. Required.
|
|
946
|
+
:type job_id: str
|
|
947
|
+
:param resource: The resource instance. Required.
|
|
948
|
+
:type resource: ~azure.quantum.models.JobUpdateOptions
|
|
949
|
+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
|
950
|
+
Default value is "application/merge-patch+json".
|
|
951
|
+
:paramtype content_type: str
|
|
952
|
+
:return: JobUpdateOptions. The JobUpdateOptions is compatible with MutableMapping
|
|
953
|
+
:rtype: ~azure.quantum.models.JobUpdateOptions
|
|
954
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
955
|
+
"""
|
|
956
|
+
|
|
957
|
+
@overload
|
|
958
|
+
def update(
|
|
959
|
+
self,
|
|
960
|
+
subscription_id: str,
|
|
961
|
+
resource_group_name: str,
|
|
962
|
+
workspace_name: str,
|
|
963
|
+
job_id: str,
|
|
964
|
+
resource: JSON,
|
|
738
965
|
*,
|
|
739
|
-
content_type: str = "application/
|
|
966
|
+
content_type: str = "application/merge-patch+json",
|
|
740
967
|
**kwargs: Any
|
|
741
|
-
) ->
|
|
968
|
+
) -> _models.JobUpdateOptions:
|
|
742
969
|
"""Update job properties.
|
|
743
970
|
|
|
744
971
|
:param subscription_id: The Azure subscription ID. Required.
|
|
@@ -750,12 +977,12 @@ class JobsOperations:
|
|
|
750
977
|
:param job_id: Id of the job. Required.
|
|
751
978
|
:type job_id: str
|
|
752
979
|
:param resource: The resource instance. Required.
|
|
753
|
-
:type resource:
|
|
980
|
+
:type resource: JSON
|
|
754
981
|
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
|
755
|
-
Default value is "application/
|
|
982
|
+
Default value is "application/merge-patch+json".
|
|
756
983
|
:paramtype content_type: str
|
|
757
|
-
:return:
|
|
758
|
-
:rtype: ~azure.quantum.models.
|
|
984
|
+
:return: JobUpdateOptions. The JobUpdateOptions is compatible with MutableMapping
|
|
985
|
+
:rtype: ~azure.quantum.models.JobUpdateOptions
|
|
759
986
|
:raises ~azure.core.exceptions.HttpResponseError:
|
|
760
987
|
"""
|
|
761
988
|
|
|
@@ -768,9 +995,9 @@ class JobsOperations:
|
|
|
768
995
|
job_id: str,
|
|
769
996
|
resource: IO[bytes],
|
|
770
997
|
*,
|
|
771
|
-
content_type: str = "application/
|
|
998
|
+
content_type: str = "application/merge-patch+json",
|
|
772
999
|
**kwargs: Any
|
|
773
|
-
) ->
|
|
1000
|
+
) -> _models.JobUpdateOptions:
|
|
774
1001
|
"""Update job properties.
|
|
775
1002
|
|
|
776
1003
|
:param subscription_id: The Azure subscription ID. Required.
|
|
@@ -784,23 +1011,38 @@ class JobsOperations:
|
|
|
784
1011
|
:param resource: The resource instance. Required.
|
|
785
1012
|
:type resource: IO[bytes]
|
|
786
1013
|
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
|
787
|
-
Default value is "application/
|
|
1014
|
+
Default value is "application/merge-patch+json".
|
|
788
1015
|
:paramtype content_type: str
|
|
789
|
-
:return:
|
|
790
|
-
:rtype: ~azure.quantum.models.
|
|
1016
|
+
:return: JobUpdateOptions. The JobUpdateOptions is compatible with MutableMapping
|
|
1017
|
+
:rtype: ~azure.quantum.models.JobUpdateOptions
|
|
791
1018
|
:raises ~azure.core.exceptions.HttpResponseError:
|
|
792
1019
|
"""
|
|
793
1020
|
|
|
794
1021
|
@distributed_trace
|
|
1022
|
+
@api_version_validation(
|
|
1023
|
+
method_added_on="2025-09-01-preview",
|
|
1024
|
+
params_added_on={
|
|
1025
|
+
"2025-09-01-preview": [
|
|
1026
|
+
"api_version",
|
|
1027
|
+
"subscription_id",
|
|
1028
|
+
"resource_group_name",
|
|
1029
|
+
"workspace_name",
|
|
1030
|
+
"job_id",
|
|
1031
|
+
"content_type",
|
|
1032
|
+
"accept",
|
|
1033
|
+
]
|
|
1034
|
+
},
|
|
1035
|
+
api_versions_list=["2025-09-01-preview", "2025-12-01-preview"],
|
|
1036
|
+
)
|
|
795
1037
|
def update(
|
|
796
1038
|
self,
|
|
797
1039
|
subscription_id: str,
|
|
798
1040
|
resource_group_name: str,
|
|
799
1041
|
workspace_name: str,
|
|
800
1042
|
job_id: str,
|
|
801
|
-
resource: Union[
|
|
1043
|
+
resource: Union[_models.JobUpdateOptions, JSON, IO[bytes]],
|
|
802
1044
|
**kwargs: Any
|
|
803
|
-
) ->
|
|
1045
|
+
) -> _models.JobUpdateOptions:
|
|
804
1046
|
"""Update job properties.
|
|
805
1047
|
|
|
806
1048
|
:param subscription_id: The Azure subscription ID. Required.
|
|
@@ -811,11 +1053,11 @@ class JobsOperations:
|
|
|
811
1053
|
:type workspace_name: str
|
|
812
1054
|
:param job_id: Id of the job. Required.
|
|
813
1055
|
:type job_id: str
|
|
814
|
-
:param resource: The resource instance. Is
|
|
815
|
-
Required.
|
|
816
|
-
:type resource:
|
|
817
|
-
:return:
|
|
818
|
-
:rtype: ~azure.quantum.models.
|
|
1056
|
+
:param resource: The resource instance. Is one of the following types: JobUpdateOptions, JSON,
|
|
1057
|
+
IO[bytes] Required.
|
|
1058
|
+
:type resource: ~azure.quantum.models.JobUpdateOptions or JSON or IO[bytes]
|
|
1059
|
+
:return: JobUpdateOptions. The JobUpdateOptions is compatible with MutableMapping
|
|
1060
|
+
:rtype: ~azure.quantum.models.JobUpdateOptions
|
|
819
1061
|
:raises ~azure.core.exceptions.HttpResponseError:
|
|
820
1062
|
"""
|
|
821
1063
|
error_map: MutableMapping = {
|
|
@@ -830,16 +1072,16 @@ class JobsOperations:
|
|
|
830
1072
|
_params = kwargs.pop("params", {}) or {}
|
|
831
1073
|
|
|
832
1074
|
content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
|
|
833
|
-
cls: ClsType[
|
|
1075
|
+
cls: ClsType[_models.JobUpdateOptions] = kwargs.pop("cls", None)
|
|
834
1076
|
|
|
835
|
-
content_type = content_type or "application/
|
|
1077
|
+
content_type = content_type or "application/merge-patch+json"
|
|
836
1078
|
_content = None
|
|
837
1079
|
if isinstance(resource, (IOBase, bytes)):
|
|
838
1080
|
_content = resource
|
|
839
1081
|
else:
|
|
840
1082
|
_content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
|
|
841
1083
|
|
|
842
|
-
_request =
|
|
1084
|
+
_request = build_services_jobs_update_request(
|
|
843
1085
|
subscription_id=subscription_id,
|
|
844
1086
|
resource_group_name=resource_group_name,
|
|
845
1087
|
workspace_name=workspace_name,
|
|
@@ -851,10 +1093,7 @@ class JobsOperations:
|
|
|
851
1093
|
params=_params,
|
|
852
1094
|
)
|
|
853
1095
|
path_format_arguments = {
|
|
854
|
-
"
|
|
855
|
-
"serviceBaseUrl": self._serialize.url(
|
|
856
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
857
|
-
),
|
|
1096
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
858
1097
|
}
|
|
859
1098
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
860
1099
|
|
|
@@ -865,7 +1104,7 @@ class JobsOperations:
|
|
|
865
1104
|
|
|
866
1105
|
response = pipeline_response.http_response
|
|
867
1106
|
|
|
868
|
-
if response.status_code not in [200
|
|
1107
|
+
if response.status_code not in [200]:
|
|
869
1108
|
if _stream:
|
|
870
1109
|
try:
|
|
871
1110
|
response.read() # Load the body in memory and close the socket
|
|
@@ -874,12 +1113,10 @@ class JobsOperations:
|
|
|
874
1113
|
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
875
1114
|
raise HttpResponseError(response=response)
|
|
876
1115
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
else:
|
|
882
|
-
deserialized = _deserialize(_models.JobDetails, response.json())
|
|
1116
|
+
if _stream:
|
|
1117
|
+
deserialized = response.iter_bytes()
|
|
1118
|
+
else:
|
|
1119
|
+
deserialized = _deserialize(_models.JobUpdateOptions, response.json())
|
|
883
1120
|
|
|
884
1121
|
if cls:
|
|
885
1122
|
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
@@ -890,7 +1127,7 @@ class JobsOperations:
|
|
|
890
1127
|
def delete( # pylint: disable=inconsistent-return-statements
|
|
891
1128
|
self, subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
892
1129
|
) -> None:
|
|
893
|
-
"""
|
|
1130
|
+
"""Delete a job by its id. Use for cancellation in versions before 2025-12-01-preview.
|
|
894
1131
|
|
|
895
1132
|
:param subscription_id: The Azure subscription ID. Required.
|
|
896
1133
|
:type subscription_id: str
|
|
@@ -917,7 +1154,7 @@ class JobsOperations:
|
|
|
917
1154
|
|
|
918
1155
|
cls: ClsType[None] = kwargs.pop("cls", None)
|
|
919
1156
|
|
|
920
|
-
_request =
|
|
1157
|
+
_request = build_services_jobs_delete_request(
|
|
921
1158
|
subscription_id=subscription_id,
|
|
922
1159
|
resource_group_name=resource_group_name,
|
|
923
1160
|
workspace_name=workspace_name,
|
|
@@ -927,10 +1164,7 @@ class JobsOperations:
|
|
|
927
1164
|
params=_params,
|
|
928
1165
|
)
|
|
929
1166
|
path_format_arguments = {
|
|
930
|
-
"
|
|
931
|
-
"serviceBaseUrl": self._serialize.url(
|
|
932
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
933
|
-
),
|
|
1167
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
934
1168
|
}
|
|
935
1169
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
936
1170
|
|
|
@@ -948,6 +1182,91 @@ class JobsOperations:
|
|
|
948
1182
|
if cls:
|
|
949
1183
|
return cls(pipeline_response, None, {}) # type: ignore
|
|
950
1184
|
|
|
1185
|
+
@distributed_trace
|
|
1186
|
+
@api_version_validation(
|
|
1187
|
+
method_added_on="2025-12-01-preview",
|
|
1188
|
+
params_added_on={
|
|
1189
|
+
"2025-12-01-preview": [
|
|
1190
|
+
"api_version",
|
|
1191
|
+
"subscription_id",
|
|
1192
|
+
"resource_group_name",
|
|
1193
|
+
"workspace_name",
|
|
1194
|
+
"job_id",
|
|
1195
|
+
"accept",
|
|
1196
|
+
]
|
|
1197
|
+
},
|
|
1198
|
+
api_versions_list=["2025-12-01-preview"],
|
|
1199
|
+
)
|
|
1200
|
+
def cancel(
|
|
1201
|
+
self, subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
1202
|
+
) -> _models.JobDetails:
|
|
1203
|
+
"""Request the cancellation of an existing job.
|
|
1204
|
+
|
|
1205
|
+
:param subscription_id: The Azure subscription ID. Required.
|
|
1206
|
+
:type subscription_id: str
|
|
1207
|
+
:param resource_group_name: Name of the Azure resource group. Required.
|
|
1208
|
+
:type resource_group_name: str
|
|
1209
|
+
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
1210
|
+
:type workspace_name: str
|
|
1211
|
+
:param job_id: Id of the job. Required.
|
|
1212
|
+
:type job_id: str
|
|
1213
|
+
:return: JobDetails. The JobDetails is compatible with MutableMapping
|
|
1214
|
+
:rtype: ~azure.quantum.models.JobDetails
|
|
1215
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
1216
|
+
"""
|
|
1217
|
+
error_map: MutableMapping = {
|
|
1218
|
+
401: ClientAuthenticationError,
|
|
1219
|
+
404: ResourceNotFoundError,
|
|
1220
|
+
409: ResourceExistsError,
|
|
1221
|
+
304: ResourceNotModifiedError,
|
|
1222
|
+
}
|
|
1223
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
1224
|
+
|
|
1225
|
+
_headers = kwargs.pop("headers", {}) or {}
|
|
1226
|
+
_params = kwargs.pop("params", {}) or {}
|
|
1227
|
+
|
|
1228
|
+
cls: ClsType[_models.JobDetails] = kwargs.pop("cls", None)
|
|
1229
|
+
|
|
1230
|
+
_request = build_services_jobs_cancel_request(
|
|
1231
|
+
subscription_id=subscription_id,
|
|
1232
|
+
resource_group_name=resource_group_name,
|
|
1233
|
+
workspace_name=workspace_name,
|
|
1234
|
+
job_id=job_id,
|
|
1235
|
+
api_version=self._config.api_version,
|
|
1236
|
+
headers=_headers,
|
|
1237
|
+
params=_params,
|
|
1238
|
+
)
|
|
1239
|
+
path_format_arguments = {
|
|
1240
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
1241
|
+
}
|
|
1242
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1243
|
+
|
|
1244
|
+
_stream = kwargs.pop("stream", False)
|
|
1245
|
+
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1246
|
+
_request, stream=_stream, **kwargs
|
|
1247
|
+
)
|
|
1248
|
+
|
|
1249
|
+
response = pipeline_response.http_response
|
|
1250
|
+
|
|
1251
|
+
if response.status_code not in [200]:
|
|
1252
|
+
if _stream:
|
|
1253
|
+
try:
|
|
1254
|
+
response.read() # Load the body in memory and close the socket
|
|
1255
|
+
except (StreamConsumedError, StreamClosedError):
|
|
1256
|
+
pass
|
|
1257
|
+
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1258
|
+
raise HttpResponseError(response=response)
|
|
1259
|
+
|
|
1260
|
+
if _stream:
|
|
1261
|
+
deserialized = response.iter_bytes()
|
|
1262
|
+
else:
|
|
1263
|
+
deserialized = _deserialize(_models.JobDetails, response.json())
|
|
1264
|
+
|
|
1265
|
+
if cls:
|
|
1266
|
+
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
1267
|
+
|
|
1268
|
+
return deserialized # type: ignore
|
|
1269
|
+
|
|
951
1270
|
@distributed_trace
|
|
952
1271
|
def get(
|
|
953
1272
|
self, subscription_id: str, resource_group_name: str, workspace_name: str, job_id: str, **kwargs: Any
|
|
@@ -979,7 +1298,7 @@ class JobsOperations:
|
|
|
979
1298
|
|
|
980
1299
|
cls: ClsType[_models.JobDetails] = kwargs.pop("cls", None)
|
|
981
1300
|
|
|
982
|
-
_request =
|
|
1301
|
+
_request = build_services_jobs_get_request(
|
|
983
1302
|
subscription_id=subscription_id,
|
|
984
1303
|
resource_group_name=resource_group_name,
|
|
985
1304
|
workspace_name=workspace_name,
|
|
@@ -989,10 +1308,7 @@ class JobsOperations:
|
|
|
989
1308
|
params=_params,
|
|
990
1309
|
)
|
|
991
1310
|
path_format_arguments = {
|
|
992
|
-
"
|
|
993
|
-
"serviceBaseUrl": self._serialize.url(
|
|
994
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
995
|
-
),
|
|
1311
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
996
1312
|
}
|
|
997
1313
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
998
1314
|
|
|
@@ -1023,6 +1339,10 @@ class JobsOperations:
|
|
|
1023
1339
|
return deserialized # type: ignore
|
|
1024
1340
|
|
|
1025
1341
|
@distributed_trace
|
|
1342
|
+
@api_version_validation(
|
|
1343
|
+
params_added_on={"2024-10-01-preview": ["filter", "skip", "top", "orderby"]},
|
|
1344
|
+
api_versions_list=["2024-03-01-preview", "2024-10-01-preview", "2025-09-01-preview", "2025-12-01-preview"],
|
|
1345
|
+
)
|
|
1026
1346
|
def list(
|
|
1027
1347
|
self,
|
|
1028
1348
|
subscription_id: str,
|
|
@@ -1034,7 +1354,7 @@ class JobsOperations:
|
|
|
1034
1354
|
top: Optional[int] = None,
|
|
1035
1355
|
orderby: Optional[str] = None,
|
|
1036
1356
|
**kwargs: Any
|
|
1037
|
-
) ->
|
|
1357
|
+
) -> ItemPaged["_models.JobDetails"]:
|
|
1038
1358
|
"""List all jobs.
|
|
1039
1359
|
|
|
1040
1360
|
:param subscription_id: The Azure subscription ID. Required.
|
|
@@ -1058,7 +1378,7 @@ class JobsOperations:
|
|
|
1058
1378
|
_headers = kwargs.pop("headers", {}) or {}
|
|
1059
1379
|
_params = kwargs.pop("params", {}) or {}
|
|
1060
1380
|
|
|
1061
|
-
cls: ClsType[
|
|
1381
|
+
cls: ClsType[list[_models.JobDetails]] = kwargs.pop("cls", None)
|
|
1062
1382
|
|
|
1063
1383
|
error_map: MutableMapping = {
|
|
1064
1384
|
401: ClientAuthenticationError,
|
|
@@ -1071,7 +1391,7 @@ class JobsOperations:
|
|
|
1071
1391
|
def prepare_request(next_link=None):
|
|
1072
1392
|
if not next_link:
|
|
1073
1393
|
|
|
1074
|
-
_request =
|
|
1394
|
+
_request = build_services_jobs_list_request(
|
|
1075
1395
|
subscription_id=subscription_id,
|
|
1076
1396
|
resource_group_name=resource_group_name,
|
|
1077
1397
|
workspace_name=workspace_name,
|
|
@@ -1084,9 +1404,8 @@ class JobsOperations:
|
|
|
1084
1404
|
params=_params,
|
|
1085
1405
|
)
|
|
1086
1406
|
path_format_arguments = {
|
|
1087
|
-
"
|
|
1088
|
-
|
|
1089
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1407
|
+
"endpoint": self._serialize.url(
|
|
1408
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1090
1409
|
),
|
|
1091
1410
|
}
|
|
1092
1411
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
@@ -1105,9 +1424,8 @@ class JobsOperations:
|
|
|
1105
1424
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1106
1425
|
)
|
|
1107
1426
|
path_format_arguments = {
|
|
1108
|
-
"
|
|
1109
|
-
|
|
1110
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1427
|
+
"endpoint": self._serialize.url(
|
|
1428
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1111
1429
|
),
|
|
1112
1430
|
}
|
|
1113
1431
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
@@ -1116,7 +1434,7 @@ class JobsOperations:
|
|
|
1116
1434
|
|
|
1117
1435
|
def extract_data(pipeline_response):
|
|
1118
1436
|
deserialized = pipeline_response.http_response.json()
|
|
1119
|
-
list_of_elem = _deserialize(
|
|
1437
|
+
list_of_elem = _deserialize(list[_models.JobDetails], deserialized.get("value", []))
|
|
1120
1438
|
if cls:
|
|
1121
1439
|
list_of_elem = cls(list_of_elem) # type: ignore
|
|
1122
1440
|
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
@@ -1139,36 +1457,28 @@ class JobsOperations:
|
|
|
1139
1457
|
return ItemPaged(get_next, extract_data)
|
|
1140
1458
|
|
|
1141
1459
|
|
|
1142
|
-
class
|
|
1460
|
+
class ServicesProvidersOperations:
|
|
1143
1461
|
"""
|
|
1144
1462
|
.. warning::
|
|
1145
1463
|
**DO NOT** instantiate this class directly.
|
|
1146
1464
|
|
|
1147
1465
|
Instead, you should access the following operations through
|
|
1148
|
-
:class:`~azure.quantum.
|
|
1149
|
-
:attr:`
|
|
1466
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
1467
|
+
:attr:`providers` attribute.
|
|
1150
1468
|
"""
|
|
1151
1469
|
|
|
1152
|
-
def __init__(self, *args, **kwargs):
|
|
1470
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
1153
1471
|
input_args = list(args)
|
|
1154
|
-
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
1155
|
-
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
1156
|
-
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
1157
|
-
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
1472
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
1473
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
1474
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
1475
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
1158
1476
|
|
|
1159
|
-
@
|
|
1160
|
-
def
|
|
1161
|
-
self,
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
workspace_name: str,
|
|
1165
|
-
session_id: str,
|
|
1166
|
-
resource: _models.SessionDetails,
|
|
1167
|
-
*,
|
|
1168
|
-
content_type: str = "application/json",
|
|
1169
|
-
**kwargs: Any
|
|
1170
|
-
) -> _models.SessionDetails:
|
|
1171
|
-
"""Open a new session.
|
|
1477
|
+
@distributed_trace
|
|
1478
|
+
def list(
|
|
1479
|
+
self, subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
1480
|
+
) -> ItemPaged["_models.ProviderStatus"]:
|
|
1481
|
+
"""List all providers in the workspace with their respective status.
|
|
1172
1482
|
|
|
1173
1483
|
:param subscription_id: The Azure subscription ID. Required.
|
|
1174
1484
|
:type subscription_id: str
|
|
@@ -1176,12 +1486,242 @@ class SessionsOperations:
|
|
|
1176
1486
|
:type resource_group_name: str
|
|
1177
1487
|
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
1178
1488
|
:type workspace_name: str
|
|
1179
|
-
:
|
|
1180
|
-
:
|
|
1181
|
-
:
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1489
|
+
:return: An iterator like instance of ProviderStatus
|
|
1490
|
+
:rtype: ~azure.core.paging.ItemPaged[~azure.quantum.models.ProviderStatus]
|
|
1491
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
1492
|
+
"""
|
|
1493
|
+
_headers = kwargs.pop("headers", {}) or {}
|
|
1494
|
+
_params = kwargs.pop("params", {}) or {}
|
|
1495
|
+
|
|
1496
|
+
cls: ClsType[list[_models.ProviderStatus]] = kwargs.pop("cls", None)
|
|
1497
|
+
|
|
1498
|
+
error_map: MutableMapping = {
|
|
1499
|
+
401: ClientAuthenticationError,
|
|
1500
|
+
404: ResourceNotFoundError,
|
|
1501
|
+
409: ResourceExistsError,
|
|
1502
|
+
304: ResourceNotModifiedError,
|
|
1503
|
+
}
|
|
1504
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
1505
|
+
|
|
1506
|
+
def prepare_request(next_link=None):
|
|
1507
|
+
if not next_link:
|
|
1508
|
+
|
|
1509
|
+
_request = build_services_providers_list_request(
|
|
1510
|
+
subscription_id=subscription_id,
|
|
1511
|
+
resource_group_name=resource_group_name,
|
|
1512
|
+
workspace_name=workspace_name,
|
|
1513
|
+
api_version=self._config.api_version,
|
|
1514
|
+
headers=_headers,
|
|
1515
|
+
params=_params,
|
|
1516
|
+
)
|
|
1517
|
+
path_format_arguments = {
|
|
1518
|
+
"endpoint": self._serialize.url(
|
|
1519
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1520
|
+
),
|
|
1521
|
+
}
|
|
1522
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1523
|
+
|
|
1524
|
+
else:
|
|
1525
|
+
# make call to next link with the client's api-version
|
|
1526
|
+
_parsed_next_link = urllib.parse.urlparse(next_link)
|
|
1527
|
+
_next_request_params = case_insensitive_dict(
|
|
1528
|
+
{
|
|
1529
|
+
key: [urllib.parse.quote(v) for v in value]
|
|
1530
|
+
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
|
1531
|
+
}
|
|
1532
|
+
)
|
|
1533
|
+
_next_request_params["api-version"] = self._config.api_version
|
|
1534
|
+
_request = HttpRequest(
|
|
1535
|
+
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1536
|
+
)
|
|
1537
|
+
path_format_arguments = {
|
|
1538
|
+
"endpoint": self._serialize.url(
|
|
1539
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1540
|
+
),
|
|
1541
|
+
}
|
|
1542
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1543
|
+
|
|
1544
|
+
return _request
|
|
1545
|
+
|
|
1546
|
+
def extract_data(pipeline_response):
|
|
1547
|
+
deserialized = pipeline_response.http_response.json()
|
|
1548
|
+
list_of_elem = _deserialize(list[_models.ProviderStatus], deserialized.get("value", []))
|
|
1549
|
+
if cls:
|
|
1550
|
+
list_of_elem = cls(list_of_elem) # type: ignore
|
|
1551
|
+
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
1552
|
+
|
|
1553
|
+
def get_next(next_link=None):
|
|
1554
|
+
_request = prepare_request(next_link)
|
|
1555
|
+
|
|
1556
|
+
_stream = False
|
|
1557
|
+
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1558
|
+
_request, stream=_stream, **kwargs
|
|
1559
|
+
)
|
|
1560
|
+
response = pipeline_response.http_response
|
|
1561
|
+
|
|
1562
|
+
if response.status_code not in [200]:
|
|
1563
|
+
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1564
|
+
raise HttpResponseError(response=response)
|
|
1565
|
+
|
|
1566
|
+
return pipeline_response
|
|
1567
|
+
|
|
1568
|
+
return ItemPaged(get_next, extract_data)
|
|
1569
|
+
|
|
1570
|
+
|
|
1571
|
+
class ServicesQuotasOperations:
|
|
1572
|
+
"""
|
|
1573
|
+
.. warning::
|
|
1574
|
+
**DO NOT** instantiate this class directly.
|
|
1575
|
+
|
|
1576
|
+
Instead, you should access the following operations through
|
|
1577
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
1578
|
+
:attr:`quotas` attribute.
|
|
1579
|
+
"""
|
|
1580
|
+
|
|
1581
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
1582
|
+
input_args = list(args)
|
|
1583
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
1584
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
1585
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
1586
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
1587
|
+
|
|
1588
|
+
@distributed_trace
|
|
1589
|
+
def list(
|
|
1590
|
+
self, subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
1591
|
+
) -> ItemPaged["_models.Quota"]:
|
|
1592
|
+
"""List quotas for the given workspace.
|
|
1593
|
+
|
|
1594
|
+
:param subscription_id: The Azure subscription ID. Required.
|
|
1595
|
+
:type subscription_id: str
|
|
1596
|
+
:param resource_group_name: Name of the Azure resource group. Required.
|
|
1597
|
+
:type resource_group_name: str
|
|
1598
|
+
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
1599
|
+
:type workspace_name: str
|
|
1600
|
+
:return: An iterator like instance of Quota
|
|
1601
|
+
:rtype: ~azure.core.paging.ItemPaged[~azure.quantum.models.Quota]
|
|
1602
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
1603
|
+
"""
|
|
1604
|
+
_headers = kwargs.pop("headers", {}) or {}
|
|
1605
|
+
_params = kwargs.pop("params", {}) or {}
|
|
1606
|
+
|
|
1607
|
+
cls: ClsType[list[_models.Quota]] = kwargs.pop("cls", None)
|
|
1608
|
+
|
|
1609
|
+
error_map: MutableMapping = {
|
|
1610
|
+
401: ClientAuthenticationError,
|
|
1611
|
+
404: ResourceNotFoundError,
|
|
1612
|
+
409: ResourceExistsError,
|
|
1613
|
+
304: ResourceNotModifiedError,
|
|
1614
|
+
}
|
|
1615
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
1616
|
+
|
|
1617
|
+
def prepare_request(next_link=None):
|
|
1618
|
+
if not next_link:
|
|
1619
|
+
|
|
1620
|
+
_request = build_services_quotas_list_request(
|
|
1621
|
+
subscription_id=subscription_id,
|
|
1622
|
+
resource_group_name=resource_group_name,
|
|
1623
|
+
workspace_name=workspace_name,
|
|
1624
|
+
api_version=self._config.api_version,
|
|
1625
|
+
headers=_headers,
|
|
1626
|
+
params=_params,
|
|
1627
|
+
)
|
|
1628
|
+
path_format_arguments = {
|
|
1629
|
+
"endpoint": self._serialize.url(
|
|
1630
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1631
|
+
),
|
|
1632
|
+
}
|
|
1633
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1634
|
+
|
|
1635
|
+
else:
|
|
1636
|
+
# make call to next link with the client's api-version
|
|
1637
|
+
_parsed_next_link = urllib.parse.urlparse(next_link)
|
|
1638
|
+
_next_request_params = case_insensitive_dict(
|
|
1639
|
+
{
|
|
1640
|
+
key: [urllib.parse.quote(v) for v in value]
|
|
1641
|
+
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
|
1642
|
+
}
|
|
1643
|
+
)
|
|
1644
|
+
_next_request_params["api-version"] = self._config.api_version
|
|
1645
|
+
_request = HttpRequest(
|
|
1646
|
+
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1647
|
+
)
|
|
1648
|
+
path_format_arguments = {
|
|
1649
|
+
"endpoint": self._serialize.url(
|
|
1650
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1651
|
+
),
|
|
1652
|
+
}
|
|
1653
|
+
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1654
|
+
|
|
1655
|
+
return _request
|
|
1656
|
+
|
|
1657
|
+
def extract_data(pipeline_response):
|
|
1658
|
+
deserialized = pipeline_response.http_response.json()
|
|
1659
|
+
list_of_elem = _deserialize(list[_models.Quota], deserialized.get("value", []))
|
|
1660
|
+
if cls:
|
|
1661
|
+
list_of_elem = cls(list_of_elem) # type: ignore
|
|
1662
|
+
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
1663
|
+
|
|
1664
|
+
def get_next(next_link=None):
|
|
1665
|
+
_request = prepare_request(next_link)
|
|
1666
|
+
|
|
1667
|
+
_stream = False
|
|
1668
|
+
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1669
|
+
_request, stream=_stream, **kwargs
|
|
1670
|
+
)
|
|
1671
|
+
response = pipeline_response.http_response
|
|
1672
|
+
|
|
1673
|
+
if response.status_code not in [200]:
|
|
1674
|
+
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1675
|
+
raise HttpResponseError(response=response)
|
|
1676
|
+
|
|
1677
|
+
return pipeline_response
|
|
1678
|
+
|
|
1679
|
+
return ItemPaged(get_next, extract_data)
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
class ServicesSessionsOperations:
|
|
1683
|
+
"""
|
|
1684
|
+
.. warning::
|
|
1685
|
+
**DO NOT** instantiate this class directly.
|
|
1686
|
+
|
|
1687
|
+
Instead, you should access the following operations through
|
|
1688
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
1689
|
+
:attr:`sessions` attribute.
|
|
1690
|
+
"""
|
|
1691
|
+
|
|
1692
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
1693
|
+
input_args = list(args)
|
|
1694
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
1695
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
1696
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
1697
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
1698
|
+
|
|
1699
|
+
@overload
|
|
1700
|
+
def open(
|
|
1701
|
+
self,
|
|
1702
|
+
subscription_id: str,
|
|
1703
|
+
resource_group_name: str,
|
|
1704
|
+
workspace_name: str,
|
|
1705
|
+
session_id: str,
|
|
1706
|
+
resource: _models.SessionDetails,
|
|
1707
|
+
*,
|
|
1708
|
+
content_type: str = "application/json",
|
|
1709
|
+
**kwargs: Any
|
|
1710
|
+
) -> _models.SessionDetails:
|
|
1711
|
+
"""Open a new session.
|
|
1712
|
+
|
|
1713
|
+
:param subscription_id: The Azure subscription ID. Required.
|
|
1714
|
+
:type subscription_id: str
|
|
1715
|
+
:param resource_group_name: Name of the Azure resource group. Required.
|
|
1716
|
+
:type resource_group_name: str
|
|
1717
|
+
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
1718
|
+
:type workspace_name: str
|
|
1719
|
+
:param session_id: Id of the session. Required.
|
|
1720
|
+
:type session_id: str
|
|
1721
|
+
:param resource: The resource instance. Required.
|
|
1722
|
+
:type resource: ~azure.quantum.models.SessionDetails
|
|
1723
|
+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
|
1724
|
+
Default value is "application/json".
|
|
1185
1725
|
:paramtype content_type: str
|
|
1186
1726
|
:return: SessionDetails. The SessionDetails is compatible with MutableMapping
|
|
1187
1727
|
:rtype: ~azure.quantum.models.SessionDetails
|
|
@@ -1189,7 +1729,7 @@ class SessionsOperations:
|
|
|
1189
1729
|
"""
|
|
1190
1730
|
|
|
1191
1731
|
@overload
|
|
1192
|
-
def
|
|
1732
|
+
def open(
|
|
1193
1733
|
self,
|
|
1194
1734
|
subscription_id: str,
|
|
1195
1735
|
resource_group_name: str,
|
|
@@ -1221,7 +1761,7 @@ class SessionsOperations:
|
|
|
1221
1761
|
"""
|
|
1222
1762
|
|
|
1223
1763
|
@overload
|
|
1224
|
-
def
|
|
1764
|
+
def open(
|
|
1225
1765
|
self,
|
|
1226
1766
|
subscription_id: str,
|
|
1227
1767
|
resource_group_name: str,
|
|
@@ -1253,7 +1793,7 @@ class SessionsOperations:
|
|
|
1253
1793
|
"""
|
|
1254
1794
|
|
|
1255
1795
|
@distributed_trace
|
|
1256
|
-
def
|
|
1796
|
+
def open(
|
|
1257
1797
|
self,
|
|
1258
1798
|
subscription_id: str,
|
|
1259
1799
|
resource_group_name: str,
|
|
@@ -1300,7 +1840,7 @@ class SessionsOperations:
|
|
|
1300
1840
|
else:
|
|
1301
1841
|
_content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
|
|
1302
1842
|
|
|
1303
|
-
_request =
|
|
1843
|
+
_request = build_services_sessions_open_request(
|
|
1304
1844
|
subscription_id=subscription_id,
|
|
1305
1845
|
resource_group_name=resource_group_name,
|
|
1306
1846
|
workspace_name=workspace_name,
|
|
@@ -1312,10 +1852,7 @@ class SessionsOperations:
|
|
|
1312
1852
|
params=_params,
|
|
1313
1853
|
)
|
|
1314
1854
|
path_format_arguments = {
|
|
1315
|
-
"
|
|
1316
|
-
"serviceBaseUrl": self._serialize.url(
|
|
1317
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1318
|
-
),
|
|
1855
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
1319
1856
|
}
|
|
1320
1857
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1321
1858
|
|
|
@@ -1376,7 +1913,7 @@ class SessionsOperations:
|
|
|
1376
1913
|
|
|
1377
1914
|
cls: ClsType[_models.SessionDetails] = kwargs.pop("cls", None)
|
|
1378
1915
|
|
|
1379
|
-
_request =
|
|
1916
|
+
_request = build_services_sessions_close_request(
|
|
1380
1917
|
subscription_id=subscription_id,
|
|
1381
1918
|
resource_group_name=resource_group_name,
|
|
1382
1919
|
workspace_name=workspace_name,
|
|
@@ -1386,10 +1923,7 @@ class SessionsOperations:
|
|
|
1386
1923
|
params=_params,
|
|
1387
1924
|
)
|
|
1388
1925
|
path_format_arguments = {
|
|
1389
|
-
"
|
|
1390
|
-
"serviceBaseUrl": self._serialize.url(
|
|
1391
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1392
|
-
),
|
|
1926
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
1393
1927
|
}
|
|
1394
1928
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1395
1929
|
|
|
@@ -1450,7 +1984,7 @@ class SessionsOperations:
|
|
|
1450
1984
|
|
|
1451
1985
|
cls: ClsType[_models.SessionDetails] = kwargs.pop("cls", None)
|
|
1452
1986
|
|
|
1453
|
-
_request =
|
|
1987
|
+
_request = build_services_sessions_get_request(
|
|
1454
1988
|
subscription_id=subscription_id,
|
|
1455
1989
|
resource_group_name=resource_group_name,
|
|
1456
1990
|
workspace_name=workspace_name,
|
|
@@ -1460,10 +1994,7 @@ class SessionsOperations:
|
|
|
1460
1994
|
params=_params,
|
|
1461
1995
|
)
|
|
1462
1996
|
path_format_arguments = {
|
|
1463
|
-
"
|
|
1464
|
-
"serviceBaseUrl": self._serialize.url(
|
|
1465
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1466
|
-
),
|
|
1997
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
1467
1998
|
}
|
|
1468
1999
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1469
2000
|
|
|
@@ -1494,7 +2025,24 @@ class SessionsOperations:
|
|
|
1494
2025
|
return deserialized # type: ignore
|
|
1495
2026
|
|
|
1496
2027
|
@distributed_trace
|
|
1497
|
-
|
|
2028
|
+
@api_version_validation(
|
|
2029
|
+
method_added_on="2024-10-01-preview",
|
|
2030
|
+
params_added_on={
|
|
2031
|
+
"2024-10-01-preview": [
|
|
2032
|
+
"api_version",
|
|
2033
|
+
"subscription_id",
|
|
2034
|
+
"resource_group_name",
|
|
2035
|
+
"workspace_name",
|
|
2036
|
+
"filter",
|
|
2037
|
+
"skip",
|
|
2038
|
+
"top",
|
|
2039
|
+
"orderby",
|
|
2040
|
+
"accept",
|
|
2041
|
+
]
|
|
2042
|
+
},
|
|
2043
|
+
api_versions_list=["2024-10-01-preview", "2025-09-01-preview", "2025-12-01-preview"],
|
|
2044
|
+
)
|
|
2045
|
+
def listv2(
|
|
1498
2046
|
self,
|
|
1499
2047
|
subscription_id: str,
|
|
1500
2048
|
resource_group_name: str,
|
|
@@ -1505,7 +2053,7 @@ class SessionsOperations:
|
|
|
1505
2053
|
top: Optional[int] = None,
|
|
1506
2054
|
orderby: Optional[str] = None,
|
|
1507
2055
|
**kwargs: Any
|
|
1508
|
-
) ->
|
|
2056
|
+
) -> ItemPaged["_models.SessionDetails"]:
|
|
1509
2057
|
"""List all Sessions.
|
|
1510
2058
|
|
|
1511
2059
|
:param subscription_id: The Azure subscription ID. Required.
|
|
@@ -1529,7 +2077,7 @@ class SessionsOperations:
|
|
|
1529
2077
|
_headers = kwargs.pop("headers", {}) or {}
|
|
1530
2078
|
_params = kwargs.pop("params", {}) or {}
|
|
1531
2079
|
|
|
1532
|
-
cls: ClsType[
|
|
2080
|
+
cls: ClsType[list[_models.SessionDetails]] = kwargs.pop("cls", None)
|
|
1533
2081
|
|
|
1534
2082
|
error_map: MutableMapping = {
|
|
1535
2083
|
401: ClientAuthenticationError,
|
|
@@ -1542,7 +2090,7 @@ class SessionsOperations:
|
|
|
1542
2090
|
def prepare_request(next_link=None):
|
|
1543
2091
|
if not next_link:
|
|
1544
2092
|
|
|
1545
|
-
_request =
|
|
2093
|
+
_request = build_services_sessions_listv2_request(
|
|
1546
2094
|
subscription_id=subscription_id,
|
|
1547
2095
|
resource_group_name=resource_group_name,
|
|
1548
2096
|
workspace_name=workspace_name,
|
|
@@ -1555,9 +2103,8 @@ class SessionsOperations:
|
|
|
1555
2103
|
params=_params,
|
|
1556
2104
|
)
|
|
1557
2105
|
path_format_arguments = {
|
|
1558
|
-
"
|
|
1559
|
-
|
|
1560
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2106
|
+
"endpoint": self._serialize.url(
|
|
2107
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1561
2108
|
),
|
|
1562
2109
|
}
|
|
1563
2110
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
@@ -1576,9 +2123,8 @@ class SessionsOperations:
|
|
|
1576
2123
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1577
2124
|
)
|
|
1578
2125
|
path_format_arguments = {
|
|
1579
|
-
"
|
|
1580
|
-
|
|
1581
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2126
|
+
"endpoint": self._serialize.url(
|
|
2127
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1582
2128
|
),
|
|
1583
2129
|
}
|
|
1584
2130
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
@@ -1587,7 +2133,7 @@ class SessionsOperations:
|
|
|
1587
2133
|
|
|
1588
2134
|
def extract_data(pipeline_response):
|
|
1589
2135
|
deserialized = pipeline_response.http_response.json()
|
|
1590
|
-
list_of_elem = _deserialize(
|
|
2136
|
+
list_of_elem = _deserialize(list[_models.SessionDetails], deserialized.get("value", []))
|
|
1591
2137
|
if cls:
|
|
1592
2138
|
list_of_elem = cls(list_of_elem) # type: ignore
|
|
1593
2139
|
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
@@ -1610,6 +2156,10 @@ class SessionsOperations:
|
|
|
1610
2156
|
return ItemPaged(get_next, extract_data)
|
|
1611
2157
|
|
|
1612
2158
|
@distributed_trace
|
|
2159
|
+
@api_version_validation(
|
|
2160
|
+
params_added_on={"2024-10-01-preview": ["filter", "skip", "top", "orderby"]},
|
|
2161
|
+
api_versions_list=["2024-03-01-preview", "2024-10-01-preview", "2025-09-01-preview", "2025-12-01-preview"],
|
|
2162
|
+
)
|
|
1613
2163
|
def jobs_list(
|
|
1614
2164
|
self,
|
|
1615
2165
|
subscription_id: str,
|
|
@@ -1622,7 +2172,7 @@ class SessionsOperations:
|
|
|
1622
2172
|
top: Optional[int] = None,
|
|
1623
2173
|
orderby: Optional[str] = None,
|
|
1624
2174
|
**kwargs: Any
|
|
1625
|
-
) ->
|
|
2175
|
+
) -> ItemPaged["_models.JobDetails"]:
|
|
1626
2176
|
"""List jobs in a session.
|
|
1627
2177
|
|
|
1628
2178
|
:param subscription_id: The Azure subscription ID. Required.
|
|
@@ -1648,7 +2198,7 @@ class SessionsOperations:
|
|
|
1648
2198
|
_headers = kwargs.pop("headers", {}) or {}
|
|
1649
2199
|
_params = kwargs.pop("params", {}) or {}
|
|
1650
2200
|
|
|
1651
|
-
cls: ClsType[
|
|
2201
|
+
cls: ClsType[list[_models.JobDetails]] = kwargs.pop("cls", None)
|
|
1652
2202
|
|
|
1653
2203
|
error_map: MutableMapping = {
|
|
1654
2204
|
401: ClientAuthenticationError,
|
|
@@ -1661,7 +2211,7 @@ class SessionsOperations:
|
|
|
1661
2211
|
def prepare_request(next_link=None):
|
|
1662
2212
|
if not next_link:
|
|
1663
2213
|
|
|
1664
|
-
_request =
|
|
2214
|
+
_request = build_services_sessions_jobs_list_request(
|
|
1665
2215
|
subscription_id=subscription_id,
|
|
1666
2216
|
resource_group_name=resource_group_name,
|
|
1667
2217
|
workspace_name=workspace_name,
|
|
@@ -1675,9 +2225,8 @@ class SessionsOperations:
|
|
|
1675
2225
|
params=_params,
|
|
1676
2226
|
)
|
|
1677
2227
|
path_format_arguments = {
|
|
1678
|
-
"
|
|
1679
|
-
|
|
1680
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2228
|
+
"endpoint": self._serialize.url(
|
|
2229
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1681
2230
|
),
|
|
1682
2231
|
}
|
|
1683
2232
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
@@ -1696,9 +2245,8 @@ class SessionsOperations:
|
|
|
1696
2245
|
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1697
2246
|
)
|
|
1698
2247
|
path_format_arguments = {
|
|
1699
|
-
"
|
|
1700
|
-
|
|
1701
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2248
|
+
"endpoint": self._serialize.url(
|
|
2249
|
+
"self._config.endpoint", self._config.endpoint, "str", skip_quote=True
|
|
1702
2250
|
),
|
|
1703
2251
|
}
|
|
1704
2252
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
@@ -1707,7 +2255,7 @@ class SessionsOperations:
|
|
|
1707
2255
|
|
|
1708
2256
|
def extract_data(pipeline_response):
|
|
1709
2257
|
deserialized = pipeline_response.http_response.json()
|
|
1710
|
-
list_of_elem = _deserialize(
|
|
2258
|
+
list_of_elem = _deserialize(list[_models.JobDetails], deserialized.get("value", []))
|
|
1711
2259
|
if cls:
|
|
1712
2260
|
list_of_elem = cls(list_of_elem) # type: ignore
|
|
1713
2261
|
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
@@ -1730,28 +2278,36 @@ class SessionsOperations:
|
|
|
1730
2278
|
return ItemPaged(get_next, extract_data)
|
|
1731
2279
|
|
|
1732
2280
|
|
|
1733
|
-
class
|
|
2281
|
+
class ServicesStorageOperations:
|
|
1734
2282
|
"""
|
|
1735
2283
|
.. warning::
|
|
1736
2284
|
**DO NOT** instantiate this class directly.
|
|
1737
2285
|
|
|
1738
2286
|
Instead, you should access the following operations through
|
|
1739
|
-
:class:`~azure.quantum.
|
|
1740
|
-
:attr:`
|
|
2287
|
+
:class:`~azure.quantum.WorkspaceClient`'s
|
|
2288
|
+
:attr:`storage` attribute.
|
|
1741
2289
|
"""
|
|
1742
2290
|
|
|
1743
|
-
def __init__(self, *args, **kwargs):
|
|
2291
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
1744
2292
|
input_args = list(args)
|
|
1745
|
-
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
1746
|
-
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
1747
|
-
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
1748
|
-
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
2293
|
+
self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
2294
|
+
self._config: WorkspaceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
2295
|
+
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
2296
|
+
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
1749
2297
|
|
|
1750
|
-
@
|
|
1751
|
-
def
|
|
1752
|
-
self,
|
|
1753
|
-
|
|
1754
|
-
|
|
2298
|
+
@overload
|
|
2299
|
+
def get_sas_uri(
|
|
2300
|
+
self,
|
|
2301
|
+
subscription_id: str,
|
|
2302
|
+
resource_group_name: str,
|
|
2303
|
+
workspace_name: str,
|
|
2304
|
+
blob_details: _models.BlobDetails,
|
|
2305
|
+
*,
|
|
2306
|
+
content_type: str = "application/json",
|
|
2307
|
+
**kwargs: Any
|
|
2308
|
+
) -> _models.SasUriResponse:
|
|
2309
|
+
"""Gets a URL with SAS token for a container/blob in the storage account associated with the
|
|
2310
|
+
workspace. The SAS URL can be used to upload job input and/or download job output.
|
|
1755
2311
|
|
|
1756
2312
|
:param subscription_id: The Azure subscription ID. Required.
|
|
1757
2313
|
:type subscription_id: str
|
|
@@ -1759,150 +2315,29 @@ class ProvidersOperations:
|
|
|
1759
2315
|
:type resource_group_name: str
|
|
1760
2316
|
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
1761
2317
|
:type workspace_name: str
|
|
1762
|
-
:
|
|
1763
|
-
:
|
|
2318
|
+
:param blob_details: The details (name and container) of the blob. Required.
|
|
2319
|
+
:type blob_details: ~azure.quantum.models.BlobDetails
|
|
2320
|
+
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
|
2321
|
+
Default value is "application/json".
|
|
2322
|
+
:paramtype content_type: str
|
|
2323
|
+
:return: SasUriResponse. The SasUriResponse is compatible with MutableMapping
|
|
2324
|
+
:rtype: ~azure.quantum.models.SasUriResponse
|
|
1764
2325
|
:raises ~azure.core.exceptions.HttpResponseError:
|
|
1765
2326
|
"""
|
|
1766
|
-
_headers = kwargs.pop("headers", {}) or {}
|
|
1767
|
-
_params = kwargs.pop("params", {}) or {}
|
|
1768
2327
|
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
_request = build_providers_list_request(
|
|
1783
|
-
subscription_id=subscription_id,
|
|
1784
|
-
resource_group_name=resource_group_name,
|
|
1785
|
-
workspace_name=workspace_name,
|
|
1786
|
-
api_version=self._config.api_version,
|
|
1787
|
-
headers=_headers,
|
|
1788
|
-
params=_params,
|
|
1789
|
-
)
|
|
1790
|
-
path_format_arguments = {
|
|
1791
|
-
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
1792
|
-
"serviceBaseUrl": self._serialize.url(
|
|
1793
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1794
|
-
),
|
|
1795
|
-
}
|
|
1796
|
-
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1797
|
-
|
|
1798
|
-
else:
|
|
1799
|
-
# make call to next link with the client's api-version
|
|
1800
|
-
_parsed_next_link = urllib.parse.urlparse(next_link)
|
|
1801
|
-
_next_request_params = case_insensitive_dict(
|
|
1802
|
-
{
|
|
1803
|
-
key: [urllib.parse.quote(v) for v in value]
|
|
1804
|
-
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
|
1805
|
-
}
|
|
1806
|
-
)
|
|
1807
|
-
_next_request_params["api-version"] = self._config.api_version
|
|
1808
|
-
_request = HttpRequest(
|
|
1809
|
-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
1810
|
-
)
|
|
1811
|
-
path_format_arguments = {
|
|
1812
|
-
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
1813
|
-
"serviceBaseUrl": self._serialize.url(
|
|
1814
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
1815
|
-
),
|
|
1816
|
-
}
|
|
1817
|
-
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
1818
|
-
|
|
1819
|
-
return _request
|
|
1820
|
-
|
|
1821
|
-
def extract_data(pipeline_response):
|
|
1822
|
-
deserialized = pipeline_response.http_response.json()
|
|
1823
|
-
list_of_elem = _deserialize(List[_models.ProviderStatus], deserialized["value"])
|
|
1824
|
-
if cls:
|
|
1825
|
-
list_of_elem = cls(list_of_elem) # type: ignore
|
|
1826
|
-
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
1827
|
-
|
|
1828
|
-
def get_next(next_link=None):
|
|
1829
|
-
_request = prepare_request(next_link)
|
|
1830
|
-
|
|
1831
|
-
_stream = False
|
|
1832
|
-
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
1833
|
-
_request, stream=_stream, **kwargs
|
|
1834
|
-
)
|
|
1835
|
-
response = pipeline_response.http_response
|
|
1836
|
-
|
|
1837
|
-
if response.status_code not in [200]:
|
|
1838
|
-
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
1839
|
-
raise HttpResponseError(response=response)
|
|
1840
|
-
|
|
1841
|
-
return pipeline_response
|
|
1842
|
-
|
|
1843
|
-
return ItemPaged(get_next, extract_data)
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
class StorageOperations:
|
|
1847
|
-
"""
|
|
1848
|
-
.. warning::
|
|
1849
|
-
**DO NOT** instantiate this class directly.
|
|
1850
|
-
|
|
1851
|
-
Instead, you should access the following operations through
|
|
1852
|
-
:class:`~azure.quantum.ServicesClient`'s
|
|
1853
|
-
:attr:`storage` attribute.
|
|
1854
|
-
"""
|
|
1855
|
-
|
|
1856
|
-
def __init__(self, *args, **kwargs):
|
|
1857
|
-
input_args = list(args)
|
|
1858
|
-
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
1859
|
-
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
1860
|
-
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
1861
|
-
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
1862
|
-
|
|
1863
|
-
@overload
|
|
1864
|
-
def get_sas_uri(
|
|
1865
|
-
self,
|
|
1866
|
-
subscription_id: str,
|
|
1867
|
-
resource_group_name: str,
|
|
1868
|
-
workspace_name: str,
|
|
1869
|
-
blob_details: _models.BlobDetails,
|
|
1870
|
-
*,
|
|
1871
|
-
content_type: str = "application/json",
|
|
1872
|
-
**kwargs: Any
|
|
1873
|
-
) -> _models.SasUriResponse:
|
|
1874
|
-
"""Gets a URL with SAS token for a container/blob in the storage account associated with the
|
|
1875
|
-
workspace. The SAS URL can be used to upload job input and/or download job output.
|
|
1876
|
-
|
|
1877
|
-
:param subscription_id: The Azure subscription ID. Required.
|
|
1878
|
-
:type subscription_id: str
|
|
1879
|
-
:param resource_group_name: Name of the Azure resource group. Required.
|
|
1880
|
-
:type resource_group_name: str
|
|
1881
|
-
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
1882
|
-
:type workspace_name: str
|
|
1883
|
-
:param blob_details: The details (name and container) of the blob. Required.
|
|
1884
|
-
:type blob_details: ~azure.quantum.models.BlobDetails
|
|
1885
|
-
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
|
1886
|
-
Default value is "application/json".
|
|
1887
|
-
:paramtype content_type: str
|
|
1888
|
-
:return: SasUriResponse. The SasUriResponse is compatible with MutableMapping
|
|
1889
|
-
:rtype: ~azure.quantum.models.SasUriResponse
|
|
1890
|
-
:raises ~azure.core.exceptions.HttpResponseError:
|
|
1891
|
-
"""
|
|
1892
|
-
|
|
1893
|
-
@overload
|
|
1894
|
-
def get_sas_uri(
|
|
1895
|
-
self,
|
|
1896
|
-
subscription_id: str,
|
|
1897
|
-
resource_group_name: str,
|
|
1898
|
-
workspace_name: str,
|
|
1899
|
-
blob_details: JSON,
|
|
1900
|
-
*,
|
|
1901
|
-
content_type: str = "application/json",
|
|
1902
|
-
**kwargs: Any
|
|
1903
|
-
) -> _models.SasUriResponse:
|
|
1904
|
-
"""Gets a URL with SAS token for a container/blob in the storage account associated with the
|
|
1905
|
-
workspace. The SAS URL can be used to upload job input and/or download job output.
|
|
2328
|
+
@overload
|
|
2329
|
+
def get_sas_uri(
|
|
2330
|
+
self,
|
|
2331
|
+
subscription_id: str,
|
|
2332
|
+
resource_group_name: str,
|
|
2333
|
+
workspace_name: str,
|
|
2334
|
+
blob_details: JSON,
|
|
2335
|
+
*,
|
|
2336
|
+
content_type: str = "application/json",
|
|
2337
|
+
**kwargs: Any
|
|
2338
|
+
) -> _models.SasUriResponse:
|
|
2339
|
+
"""Gets a URL with SAS token for a container/blob in the storage account associated with the
|
|
2340
|
+
workspace. The SAS URL can be used to upload job input and/or download job output.
|
|
1906
2341
|
|
|
1907
2342
|
:param subscription_id: The Azure subscription ID. Required.
|
|
1908
2343
|
:type subscription_id: str
|
|
@@ -1996,7 +2431,7 @@ class StorageOperations:
|
|
|
1996
2431
|
else:
|
|
1997
2432
|
_content = json.dumps(blob_details, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore
|
|
1998
2433
|
|
|
1999
|
-
_request =
|
|
2434
|
+
_request = build_services_storage_get_sas_uri_request(
|
|
2000
2435
|
subscription_id=subscription_id,
|
|
2001
2436
|
resource_group_name=resource_group_name,
|
|
2002
2437
|
workspace_name=workspace_name,
|
|
@@ -2007,10 +2442,7 @@ class StorageOperations:
|
|
|
2007
2442
|
params=_params,
|
|
2008
2443
|
)
|
|
2009
2444
|
path_format_arguments = {
|
|
2010
|
-
"
|
|
2011
|
-
"serviceBaseUrl": self._serialize.url(
|
|
2012
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2013
|
-
),
|
|
2445
|
+
"endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True),
|
|
2014
2446
|
}
|
|
2015
2447
|
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
2016
2448
|
|
|
@@ -2039,250 +2471,3 @@ class StorageOperations:
|
|
|
2039
2471
|
return cls(pipeline_response, deserialized, {}) # type: ignore
|
|
2040
2472
|
|
|
2041
2473
|
return deserialized # type: ignore
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
class QuotasOperations:
|
|
2045
|
-
"""
|
|
2046
|
-
.. warning::
|
|
2047
|
-
**DO NOT** instantiate this class directly.
|
|
2048
|
-
|
|
2049
|
-
Instead, you should access the following operations through
|
|
2050
|
-
:class:`~azure.quantum.ServicesClient`'s
|
|
2051
|
-
:attr:`quotas` attribute.
|
|
2052
|
-
"""
|
|
2053
|
-
|
|
2054
|
-
def __init__(self, *args, **kwargs):
|
|
2055
|
-
input_args = list(args)
|
|
2056
|
-
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
2057
|
-
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
2058
|
-
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
2059
|
-
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
2060
|
-
|
|
2061
|
-
@distributed_trace
|
|
2062
|
-
def list(
|
|
2063
|
-
self, subscription_id: str, resource_group_name: str, workspace_name: str, **kwargs: Any
|
|
2064
|
-
) -> Iterable["_models.Quota"]:
|
|
2065
|
-
"""List quotas for the given workspace.
|
|
2066
|
-
|
|
2067
|
-
:param subscription_id: The Azure subscription ID. Required.
|
|
2068
|
-
:type subscription_id: str
|
|
2069
|
-
:param resource_group_name: Name of the Azure resource group. Required.
|
|
2070
|
-
:type resource_group_name: str
|
|
2071
|
-
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
2072
|
-
:type workspace_name: str
|
|
2073
|
-
:return: An iterator like instance of Quota
|
|
2074
|
-
:rtype: ~azure.core.paging.ItemPaged[~azure.quantum.models.Quota]
|
|
2075
|
-
:raises ~azure.core.exceptions.HttpResponseError:
|
|
2076
|
-
"""
|
|
2077
|
-
_headers = kwargs.pop("headers", {}) or {}
|
|
2078
|
-
_params = kwargs.pop("params", {}) or {}
|
|
2079
|
-
|
|
2080
|
-
cls: ClsType[List[_models.Quota]] = kwargs.pop("cls", None)
|
|
2081
|
-
|
|
2082
|
-
error_map: MutableMapping = {
|
|
2083
|
-
401: ClientAuthenticationError,
|
|
2084
|
-
404: ResourceNotFoundError,
|
|
2085
|
-
409: ResourceExistsError,
|
|
2086
|
-
304: ResourceNotModifiedError,
|
|
2087
|
-
}
|
|
2088
|
-
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
2089
|
-
|
|
2090
|
-
def prepare_request(next_link=None):
|
|
2091
|
-
if not next_link:
|
|
2092
|
-
|
|
2093
|
-
_request = build_quotas_list_request(
|
|
2094
|
-
subscription_id=subscription_id,
|
|
2095
|
-
resource_group_name=resource_group_name,
|
|
2096
|
-
workspace_name=workspace_name,
|
|
2097
|
-
api_version=self._config.api_version,
|
|
2098
|
-
headers=_headers,
|
|
2099
|
-
params=_params,
|
|
2100
|
-
)
|
|
2101
|
-
path_format_arguments = {
|
|
2102
|
-
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
2103
|
-
"serviceBaseUrl": self._serialize.url(
|
|
2104
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2105
|
-
),
|
|
2106
|
-
}
|
|
2107
|
-
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
2108
|
-
|
|
2109
|
-
else:
|
|
2110
|
-
# make call to next link with the client's api-version
|
|
2111
|
-
_parsed_next_link = urllib.parse.urlparse(next_link)
|
|
2112
|
-
_next_request_params = case_insensitive_dict(
|
|
2113
|
-
{
|
|
2114
|
-
key: [urllib.parse.quote(v) for v in value]
|
|
2115
|
-
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
|
2116
|
-
}
|
|
2117
|
-
)
|
|
2118
|
-
_next_request_params["api-version"] = self._config.api_version
|
|
2119
|
-
_request = HttpRequest(
|
|
2120
|
-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
2121
|
-
)
|
|
2122
|
-
path_format_arguments = {
|
|
2123
|
-
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
2124
|
-
"serviceBaseUrl": self._serialize.url(
|
|
2125
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2126
|
-
),
|
|
2127
|
-
}
|
|
2128
|
-
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
2129
|
-
|
|
2130
|
-
return _request
|
|
2131
|
-
|
|
2132
|
-
def extract_data(pipeline_response):
|
|
2133
|
-
deserialized = pipeline_response.http_response.json()
|
|
2134
|
-
list_of_elem = _deserialize(List[_models.Quota], deserialized["value"])
|
|
2135
|
-
if cls:
|
|
2136
|
-
list_of_elem = cls(list_of_elem) # type: ignore
|
|
2137
|
-
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
2138
|
-
|
|
2139
|
-
def get_next(next_link=None):
|
|
2140
|
-
_request = prepare_request(next_link)
|
|
2141
|
-
|
|
2142
|
-
_stream = False
|
|
2143
|
-
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
2144
|
-
_request, stream=_stream, **kwargs
|
|
2145
|
-
)
|
|
2146
|
-
response = pipeline_response.http_response
|
|
2147
|
-
|
|
2148
|
-
if response.status_code not in [200]:
|
|
2149
|
-
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
2150
|
-
raise HttpResponseError(response=response)
|
|
2151
|
-
|
|
2152
|
-
return pipeline_response
|
|
2153
|
-
|
|
2154
|
-
return ItemPaged(get_next, extract_data)
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
class TopLevelItemsOperations:
|
|
2158
|
-
"""
|
|
2159
|
-
.. warning::
|
|
2160
|
-
**DO NOT** instantiate this class directly.
|
|
2161
|
-
|
|
2162
|
-
Instead, you should access the following operations through
|
|
2163
|
-
:class:`~azure.quantum.ServicesClient`'s
|
|
2164
|
-
:attr:`top_level_items` attribute.
|
|
2165
|
-
"""
|
|
2166
|
-
|
|
2167
|
-
def __init__(self, *args, **kwargs):
|
|
2168
|
-
input_args = list(args)
|
|
2169
|
-
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
|
2170
|
-
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
|
2171
|
-
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
|
2172
|
-
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
|
2173
|
-
|
|
2174
|
-
@distributed_trace
|
|
2175
|
-
def list(
|
|
2176
|
-
self,
|
|
2177
|
-
subscription_id: str,
|
|
2178
|
-
resource_group_name: str,
|
|
2179
|
-
workspace_name: str,
|
|
2180
|
-
*,
|
|
2181
|
-
filter: Optional[str] = None,
|
|
2182
|
-
skip: Optional[int] = None,
|
|
2183
|
-
top: Optional[int] = None,
|
|
2184
|
-
orderby: Optional[str] = None,
|
|
2185
|
-
**kwargs: Any
|
|
2186
|
-
) -> Iterable["_models.ItemDetails"]:
|
|
2187
|
-
"""List top-level items.
|
|
2188
|
-
|
|
2189
|
-
:param subscription_id: The Azure subscription ID. Required.
|
|
2190
|
-
:type subscription_id: str
|
|
2191
|
-
:param resource_group_name: Name of the Azure resource group. Required.
|
|
2192
|
-
:type resource_group_name: str
|
|
2193
|
-
:param workspace_name: Name of the Azure Quantum workspace. Required.
|
|
2194
|
-
:type workspace_name: str
|
|
2195
|
-
:keyword filter: Filter the result list using the given expression. Default value is None.
|
|
2196
|
-
:paramtype filter: str
|
|
2197
|
-
:keyword skip: The number of result items to skip. Default value is None.
|
|
2198
|
-
:paramtype skip: int
|
|
2199
|
-
:keyword top: The number of jobs taken. Default value is None.
|
|
2200
|
-
:paramtype top: int
|
|
2201
|
-
:keyword orderby: The order of returned items. Default value is None.
|
|
2202
|
-
:paramtype orderby: str
|
|
2203
|
-
:return: An iterator like instance of ItemDetails
|
|
2204
|
-
:rtype: ~azure.core.paging.ItemPaged[~azure.quantum.models.ItemDetails]
|
|
2205
|
-
:raises ~azure.core.exceptions.HttpResponseError:
|
|
2206
|
-
"""
|
|
2207
|
-
_headers = kwargs.pop("headers", {}) or {}
|
|
2208
|
-
_params = kwargs.pop("params", {}) or {}
|
|
2209
|
-
|
|
2210
|
-
cls: ClsType[List[_models.ItemDetails]] = kwargs.pop("cls", None)
|
|
2211
|
-
|
|
2212
|
-
error_map: MutableMapping = {
|
|
2213
|
-
401: ClientAuthenticationError,
|
|
2214
|
-
404: ResourceNotFoundError,
|
|
2215
|
-
409: ResourceExistsError,
|
|
2216
|
-
304: ResourceNotModifiedError,
|
|
2217
|
-
}
|
|
2218
|
-
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
2219
|
-
|
|
2220
|
-
def prepare_request(next_link=None):
|
|
2221
|
-
if not next_link:
|
|
2222
|
-
|
|
2223
|
-
_request = build_top_level_items_list_request(
|
|
2224
|
-
subscription_id=subscription_id,
|
|
2225
|
-
resource_group_name=resource_group_name,
|
|
2226
|
-
workspace_name=workspace_name,
|
|
2227
|
-
filter=filter,
|
|
2228
|
-
skip=skip,
|
|
2229
|
-
top=top,
|
|
2230
|
-
orderby=orderby,
|
|
2231
|
-
api_version=self._config.api_version,
|
|
2232
|
-
headers=_headers,
|
|
2233
|
-
params=_params,
|
|
2234
|
-
)
|
|
2235
|
-
path_format_arguments = {
|
|
2236
|
-
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
2237
|
-
"serviceBaseUrl": self._serialize.url(
|
|
2238
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2239
|
-
),
|
|
2240
|
-
}
|
|
2241
|
-
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
2242
|
-
|
|
2243
|
-
else:
|
|
2244
|
-
# make call to next link with the client's api-version
|
|
2245
|
-
_parsed_next_link = urllib.parse.urlparse(next_link)
|
|
2246
|
-
_next_request_params = case_insensitive_dict(
|
|
2247
|
-
{
|
|
2248
|
-
key: [urllib.parse.quote(v) for v in value]
|
|
2249
|
-
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
|
|
2250
|
-
}
|
|
2251
|
-
)
|
|
2252
|
-
_next_request_params["api-version"] = self._config.api_version
|
|
2253
|
-
_request = HttpRequest(
|
|
2254
|
-
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
|
|
2255
|
-
)
|
|
2256
|
-
path_format_arguments = {
|
|
2257
|
-
"region": self._serialize.url("self._config.region", self._config.region, "str"),
|
|
2258
|
-
"serviceBaseUrl": self._serialize.url(
|
|
2259
|
-
"self._config.service_base_url", self._config.service_base_url, "str"
|
|
2260
|
-
),
|
|
2261
|
-
}
|
|
2262
|
-
_request.url = self._client.format_url(_request.url, **path_format_arguments)
|
|
2263
|
-
|
|
2264
|
-
return _request
|
|
2265
|
-
|
|
2266
|
-
def extract_data(pipeline_response):
|
|
2267
|
-
deserialized = pipeline_response.http_response.json()
|
|
2268
|
-
list_of_elem = _deserialize(List[_models.ItemDetails], deserialized["value"])
|
|
2269
|
-
if cls:
|
|
2270
|
-
list_of_elem = cls(list_of_elem) # type: ignore
|
|
2271
|
-
return deserialized.get("nextLink") or None, iter(list_of_elem)
|
|
2272
|
-
|
|
2273
|
-
def get_next(next_link=None):
|
|
2274
|
-
_request = prepare_request(next_link)
|
|
2275
|
-
|
|
2276
|
-
_stream = False
|
|
2277
|
-
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
2278
|
-
_request, stream=_stream, **kwargs
|
|
2279
|
-
)
|
|
2280
|
-
response = pipeline_response.http_response
|
|
2281
|
-
|
|
2282
|
-
if response.status_code not in [200]:
|
|
2283
|
-
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
|
2284
|
-
raise HttpResponseError(response=response)
|
|
2285
|
-
|
|
2286
|
-
return pipeline_response
|
|
2287
|
-
|
|
2288
|
-
return ItemPaged(get_next, extract_data)
|