steps.api.cloud_objects.cloud_job ================================= .. py:module:: steps.api.cloud_objects.cloud_job Classes ------- .. autoapisummary:: steps.api.cloud_objects.cloud_job.Job Module Contents --------------- .. py:class:: 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 = '', **_) Bases: :py:obj:`steps.api.cloud_objects.cloud_base.ACloudObject` Job class representing a computational job in the cloud system. This class handles job creation, monitoring, and management operations. :param platform_name: Name of the platform to run the job on :param job_name: Name of the job :param payload: Job payload containing command, circuit, parameters, etc. :param pcvl_version: Version of the PCVL library to use :param process_id: Unique ID for the process (defaults to a new UUID) :param job_id: Job ID (empty for new jobs) :param _: Additional attributes to set on the job .. py:attribute:: JOB_NAME_KEY :value: 'job_name' .. py:attribute:: PLATFORM_NAME_KEY :value: 'platform_name' .. py:attribute:: PAYLOAD_KEY :value: 'payload' .. py:attribute:: PCVL_VERSION_KEY :value: 'pcvl_version' .. py:attribute:: PROCESS_ID_KEY :value: 'process_id' .. py:attribute:: DEFAULT_PAYLOAD .. py:method:: get_object_name() -> str :classmethod: .. py:method:: get_endpoint() -> str :classmethod: .. py:method:: get_api(context: steps.api.utils.CloudContext) -> steps.api.utils.Api :classmethod: .. py:method:: get_token_method() -> str :classmethod: .. py:attribute:: DEFAULT_PLATFORM_NAME :value: 'sim:qa' .. py:attribute:: platform_name :type: str :value: 'sim:qa' .. py:attribute:: job_name :type: str :value: 'qa_job' .. py:attribute:: payload :type: dict[str] .. py:attribute:: pcvl_version :type: str :value: '0.12.0' .. py:attribute:: process_id :type: str :value: '' .. py:attribute:: job_id :value: '' .. py:method:: create(context: steps.api.utils.CloudContext, user, create_dict: dict = {}) -> None Create this job in the cloud. :param context: Cloud context for API configuration :param user: User providing authentication :param create_dict: Additional parameters for job creation :raises RuntimeError: If job creation fails .. py:method:: read(context: steps.api.utils.CloudContext, user) -> dict[str] Read this job's information from the cloud. :param context: Cloud context for API configuration :param user: User providing authentication :return: Dictionary with job data from response :raises RuntimeError: If reading job data fails .. py:method:: cancel(context: steps.api.utils.CloudContext, user) -> dict[str] Cancel this job. :param context: Cloud context for API configuration :param user: User providing authentication :raises RuntimeError: If canceling the job fails .. py:method:: get_status(context: steps.api.utils.CloudContext, user) -> dict[str] Get the current status of this job. :param context: Cloud context for API configuration :param user: User providing authentication :return: Dictionary with job status information :raises RuntimeError: If retrieving job status fails .. py:method:: get_results(context: steps.api.utils.CloudContext, user) -> dict[str] Get the results of this job. :param context: Cloud context for API configuration :param user: User providing authentication :return: Dictionary with job results :raises RuntimeError: If retrieving job results fails .. py:method:: cancel_many(context: steps.api.utils.CloudContext, jobs: list, admin: steps.api.cloud_objects.cloud_user.User) -> None :classmethod: Cancel multiple jobs at once. :param context: Cloud context for API configuration :param jobs: List of Job objects to cancel :param admin: Admin user providing authentication :raises AssertionError: If the user is not an admin :raises RuntimeError: If canceling the jobs fails .. py:method:: list_all(context: steps.api.utils.CloudContext, admin: steps.api.cloud_objects.cloud_user.User) -> list[Job] :classmethod: List all jobs in the cloud. :param context: Cloud context for API configuration :param admin: Admin user providing authentication :return: List of Job objects :raises AssertionError: If the user is not an admin :raises RuntimeError: If listing jobs fails