Skip to content

Commit 90c2af7

Browse files
committed
feat(doc): update doc
1 parent 8686f27 commit 90c2af7

File tree

2 files changed

+152
-1
lines changed

2 files changed

+152
-1
lines changed

scaleway_qaas_client/client.py

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,44 @@ def __init__(self, project_id: str, secret_key: str, url: str = _DEFAULT_URL):
9696
def __repr__(self) -> str:
9797
return f"<QaaSClient(url={self.__client._base_url},project_id={self.__project_id})>"
9898

99+
"""Get platform information
100+
101+
Retrieve information about the provided **platform ID**, such as provider name, technology, and
102+
type.
103+
104+
Args:
105+
platform_id (str): Unique ID of the platform.
106+
107+
Raises:
108+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
109+
httpx.TimeoutException: If the request takes longer than Client.timeout.
110+
111+
Returns:
112+
ScalewayQaasV1Alpha1Platform
113+
"""
114+
99115
def get_platform(self, platform_id: str) -> ScalewayQaasV1Alpha1Platform:
100116
response = _get_platform_sync(client=self.__client, platform_id=platform_id)
101117

102118
_raise_on_error(response)
103119

104120
return response.parsed
105121

122+
"""List all available platforms
123+
124+
Retrieve information about all platforms.
125+
126+
Args:
127+
name (Union[Unset, str]): List platforms with this name.
128+
129+
Raises:
130+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
131+
httpx.TimeoutException: If the request takes longer than Client.timeout.
132+
133+
Returns:
134+
List[ScalewayQaasV1Alpha1ListPlatforms]
135+
"""
136+
106137
def list_platforms(
107138
self, name: Optional[str] = None
108139
) -> List[ScalewayQaasV1Alpha1Platform]:
@@ -112,6 +143,21 @@ def list_platforms(
112143

113144
return response.parsed.platforms
114145

146+
"""Create a session
147+
148+
Create a dedicated session for the specified platform.
149+
150+
Args:
151+
body (CreateSessionBody):
152+
153+
Raises:
154+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
155+
httpx.TimeoutException: If the request takes longer than Client.timeout.
156+
157+
Returns:
158+
ScalewayQaasV1Alpha1Session
159+
"""
160+
115161
def create_session(
116162
self,
117163
platform_id: str,
@@ -144,6 +190,22 @@ def create_session(
144190

145191
return response.parsed
146192

193+
"""Get session information
194+
195+
Retrieve information about the provided **session ID**, such as name, status, and number of executed
196+
jobs.
197+
198+
Args:
199+
session_id (str): Unique ID of the session.
200+
201+
Raises:
202+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
203+
httpx.TimeoutException: If the request takes longer than Client.timeout.
204+
205+
Returns:
206+
ScalewayQaasV1Alpha1Session
207+
"""
208+
147209
def get_session(self, session_id: str) -> ScalewayQaasV1Alpha1Session:
148210
response = _get_session_sync(client=self.__client, session_id=session_id)
149211

@@ -162,6 +224,22 @@ def list_session(
162224

163225
return response.parsed.sessions
164226

227+
"""Terminate an existing session
228+
229+
Terminate a session by its unique ID and cancel all its attached jobs and booking.
230+
231+
Args:
232+
session_id (str): Unique ID of the session.
233+
body (TerminateSessionBody):
234+
235+
Raises:
236+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
237+
httpx.TimeoutException: If the request takes longer than Client.timeout.
238+
239+
Returns:
240+
ScalewayQaasV1Alpha1Session
241+
"""
242+
165243
def terminate_session(self, session_id: str) -> ScalewayQaasV1Alpha1Session:
166244
response = _terminate_session_sync(
167245
client=self.__client,
@@ -173,9 +251,36 @@ def terminate_session(self, session_id: str) -> ScalewayQaasV1Alpha1Session:
173251

174252
return response.parsed
175253

254+
"""Delete an existing session
255+
256+
Delete a session by its unique ID and delete all its attached job and booking.
257+
258+
Args:
259+
session_id (str): Unique ID of the session.
260+
261+
Raises:
262+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
263+
httpx.TimeoutException: If the request takes longer than Client.timeout.
264+
"""
265+
176266
def delete_session(self, session_id: str):
177267
_delete_session_sync(client=self.__client, session_id=session_id)
178268

269+
"""Create a job
270+
271+
Create a job to be executed inside a session.
272+
273+
Args:
274+
body (CreateJobBody):
275+
276+
Raises:
277+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
278+
httpx.TimeoutException: If the request takes longer than Client.timeout.
279+
280+
Returns:
281+
ScalewayQaasV1Alpha1Job
282+
"""
283+
179284
def create_job(
180285
self,
181286
session_id: str,
@@ -198,20 +303,66 @@ def create_job(
198303

199304
return response.parsed
200305

306+
"""Get job information
307+
308+
Retrieve information about the provided **job ID**, such as status, payload, and result.
309+
310+
Args:
311+
job_id (str): Unique ID of the job you want to get.
312+
313+
Raises:
314+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
315+
httpx.TimeoutException: If the request takes longer than Client.timeout.
316+
317+
Returns:
318+
ScalewayQaasV1Alpha1Job
319+
"""
320+
201321
def get_job(self, job_id: str) -> ScalewayQaasV1Alpha1Job:
202322
response = _get_job_sync(client=self.__client, job_id=job_id)
203323

204324
_raise_on_error(response)
205325

206326
return response.parsed
207327

328+
"""List all results of a job
329+
330+
Retrieve all intermediate and final results of a job.
331+
332+
Args:
333+
job_id (str): ID of the job.
334+
335+
Raises:
336+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
337+
httpx.TimeoutException: If the request takes longer than Client.timeout.
338+
339+
Returns:
340+
List[ScalewayQaasV1Alpha1ListJobResultsResponse]
341+
"""
342+
208343
def list_job_results(self, job_id: str) -> List[ScalewayQaasV1Alpha1JobResult]:
209344
response = _list_job_result_sync(client=self.__client, job_id=job_id)
210345

211346
_raise_on_error(response)
212347

213348
return response.parsed.job_results
214349

350+
"""Cancel a job
351+
352+
Cancel the job corresponding to the provided **job ID**.
353+
354+
Args:
355+
job_id (str): Unique ID of the job.
356+
body (CancelJobBody):
357+
358+
Raises:
359+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
360+
httpx.TimeoutException: If the request takes longer than Client.timeout.
361+
362+
Returns:
363+
ScalewayQaasV1Alpha1Job
364+
"""
365+
215366
def cancel_job(self, job_id: str) -> ScalewayQaasV1Alpha1Job:
216367
response = _cancel_job_sync(
217368
client=self.__client,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
setup(
2424
name="scaleway_qaas_client",
25-
version="0.1.5",
25+
version="0.1.6",
2626
project_urls={
2727
"Documentation": "https://www.scaleway.com/en/quantum-as-a-service/",
2828
"Source": "https://github.com/scaleway/scaleway-qaas-client-pythom",

0 commit comments

Comments
 (0)