Skip to content

Commit 30e7024

Browse files
authored
Merge pull request #64 from Qiskit/runtime-integration
Add new `runtime_jobs` and `runtime_sessions` methods to clients
2 parents 7ffa7fb + 6acf2f6 commit 30e7024

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

qiskit_ibm_catalog/catalog.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,25 @@ def get_job_by_id(self, job_id: str) -> Optional[Job]:
166166
)
167167
return self.job(job_id=job_id)
168168

169+
def runtime_jobs(
170+
self, job_id: str, runtime_session: Optional[str] = None
171+
) -> List[str]:
172+
"""Returns list of qiskit runtime job ids associated to the catalog job id
173+
and optionally filtered by session.
174+
175+
Returns:
176+
List[str]: job ids
177+
"""
178+
return self._client.runtime_jobs(job_id, runtime_session)
179+
180+
def runtime_sessions(self, job_id: str):
181+
"""Returns list of qiskit runtime session ids associated to the catalog job id.
182+
183+
Returns:
184+
List[str]: session ids
185+
"""
186+
return self._client.runtime_sessions(job_id)
187+
169188
def files(self, function: QiskitFunction) -> List[str]:
170189
"""Returns the list of files available for the user in the Qiskit Function folder."""
171190
return self._client.files(function)

qiskit_ibm_catalog/serverless.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,25 @@ def get_job_by_id(self, job_id: str) -> Optional[Job]:
166166
)
167167
return self.job(job_id=job_id)
168168

169+
def runtime_jobs(
170+
self, job_id: str, runtime_session: Optional[str] = None
171+
) -> List[str]:
172+
"""Returns list of qiskit runtime job ids associated to the serverless job id
173+
and optionally filtered by session.
174+
175+
Returns:
176+
List[str]: job ids
177+
"""
178+
return self._client.runtime_jobs(job_id, runtime_session)
179+
180+
def runtime_sessions(self, job_id: str):
181+
"""Returns list of qiskit runtime session ids associated to the serverless job id.
182+
183+
Returns:
184+
List[str]: session ids
185+
"""
186+
return self._client.runtime_sessions(job_id)
187+
169188
def files(self, function: QiskitFunction) -> List[str]:
170189
"""Returns the list of files available for the user in the Qiskit Function folder."""
171190
return self._client.files(function)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
certifi>=2021.5.30
22
importlib_metadata>=4.8.1
3-
qiskit_serverless~=0.26.0
3+
qiskit_serverless~=0.27.0

0 commit comments

Comments
 (0)