steps.api.cloud_objects.cloud_job
Classes
Job class representing a computational job in the cloud system. |
Module Contents
- class steps.api.cloud_objects.cloud_job.Job(platform_name: str = DEFAULT_PLATFORM_NAME, job_name: str = 'qa_job', payload: dict[str] = DEFAULT_PAYLOAD, pcvl_version: str = '0.12.0', process_id: str = str(uuid4()), job_id: str = '', **_)[source]
Bases:
steps.api.cloud_objects.cloud_base.ACloudObjectJob class representing a computational job in the cloud system.
This class handles job creation, monitoring, and management operations.
- Parameters:
platform_name – Name of the platform to run the job on
job_name – Name of the job
payload – Job payload containing command, circuit, parameters, etc.
pcvl_version – Version of the PCVL library to use
process_id – Unique ID for the process (defaults to a new UUID)
job_id – Job ID (empty for new jobs)
_ – Additional attributes to set on the job
- classmethod get_api(context: steps.api.utils.CloudContext) steps.api.utils.Api[source]
- create(context: steps.api.utils.CloudContext, user, create_dict: dict = {}) None[source]
Create this job in the cloud.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
create_dict – Additional parameters for job creation
- Raises:
RuntimeError – If job creation fails
- read(context: steps.api.utils.CloudContext, user) dict[str][source]
Read this job’s information from the cloud.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
- Returns:
Dictionary with job data from response
- Raises:
RuntimeError – If reading job data fails
- cancel(context: steps.api.utils.CloudContext, user) dict[str][source]
Cancel this job.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
- Raises:
RuntimeError – If canceling the job fails
- get_status(context: steps.api.utils.CloudContext, user) dict[str][source]
Get the current status of this job.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
- Returns:
Dictionary with job status information
- Raises:
RuntimeError – If retrieving job status fails
- get_results(context: steps.api.utils.CloudContext, user) dict[str][source]
Get the results of this job.
- Parameters:
context – Cloud context for API configuration
user – User providing authentication
- Returns:
Dictionary with job results
- Raises:
RuntimeError – If retrieving job results fails
- classmethod cancel_many(context: steps.api.utils.CloudContext, jobs: list, admin: steps.api.cloud_objects.cloud_user.User) None[source]
Cancel multiple jobs at once.
- Parameters:
context – Cloud context for API configuration
jobs – List of Job objects to cancel
admin – Admin user providing authentication
- Raises:
AssertionError – If the user is not an admin
RuntimeError – If canceling the jobs fails
- classmethod list_all(context: steps.api.utils.CloudContext, admin: steps.api.cloud_objects.cloud_user.User) list[Job][source]
List all jobs in the cloud.
- Parameters:
context – Cloud context for API configuration
admin – Admin user providing authentication
- Returns:
List of Job objects
- Raises:
AssertionError – If the user is not an admin
RuntimeError – If listing jobs fails