Job maker APIs

Operations for running and managing VIANOPS jobs, such as drift detection, preprocessing, dataloading, and model performance.

vianops_client.api.jobmaker.dataloading

class DataloadingV1Api(config: Config | None = None)

Bases: JobApiBaseClass

cancel(job_model_or_id: str | V1JobModel, override=False) VianaiSuccessResponse

Cancel data loading job

Parameters:
  • job_id (Union[V1JobModel, str]) – The job model or job id to be canceled.

  • override (bool) – If True, forcefully cancel the job. Default: False.

Returns:

The response from the job cancellation request.

Return type:

VianaiSuccessResponse

cancel_url = '/v1/dataloading/cancel'
status(job_model_or_id: str | V1JobModel) V1JobModel

Retrieve data loading job status

Parameters:

job_model_or_id (Union[V1JobModel, str]) – The job model or job id for which to get the status.

Returns:

The job’s current status.

Return type:

V1JobModel

status_url = '/v1/dataloading/status'
submit(data: V1DataloadingJob, wait: bool = True) V1JobModel

Submit a data loading job

Parameters:
  • data (V1DataloadingJob) – Instance containing information for the job submission.

  • wait (bool) – If True, wait for the job to complete, return all details, including job results, will be returned; otherwise, incomplete job submission details will be return. Default: True.

Returns:

The response from the job submission.

Return type:

V1JobModel

submit_url = '/v1/dataloading/submit'

vianops_client.api.jobmaker.driftdetection

class DriftdetectionV1Api(config: Config | None = None)

Bases: JobApiBaseClass

cancel(job_id)

Cancel an in-progress drift detection job

Parameters:

job_id (str) – Job id used to identify drift detection job to cancel.

Returns:

The response from the job cancellation request.

Return type:

dict

cancel_url = '/v1/driftdetection/cancel'
status(job_id)

Retrieve drift detection job status

Parameters:

job_id (str) – The job id for which to get the status.

Returns:

The job’s current status.

Return type:

dict

status_url = '/v1/driftdetection/status'
submit(data: V1DriftDetectionJob, wait: bool = False)

Submit a drift detection job

Parameters:
  • data (V1DriftDetectionJob) – Instance containing information for the job submission.

  • wait (bool) – If True, wait for the job to complete, return all details, including job results, will be returned; otherwise, incomplete job submission details will be return. Default: True.

Returns:

Instance containing information about the submitted drift detection job.

Return type:

V1JobModel

submit_url = '/v1/driftdetection/submit'
wait_for_jobs(job_ids)

Wait for drift jobs to complete

Parameters:

job_ids (list[str]) – List of drift detection jobs to wait for.

Returns:

Response from each drift detection job once it completes.

Return type:

list[dict]

vianops_client.api.jobmaker.model_artifacts

class ModelArtifactsV1Api(config: Config | None = None)

Bases: JobApiBaseClass

add_meta(data: V1ModelRepoAddMetaJob, output_type: str = 'object') VianaiSuccessResponse | VianaiErrorResponse

Add meta information for registered models in the platform.

Parameters:

data (V1ModelRepoAddMetaJob) – The data containing metadata to be added.

Returns:

The response from adding metadata.

Return type:

Union[VianaiSuccessResponse, VianaiErrorResponse]

add_meta_post_url = '/v1/model_repo/add_meta'
delete_artifact(data: V1ModelRepoDeleteArtifactJob, output_type: str = 'object') VianaiSuccessResponse | VianaiErrorResponse

Delete artifacts for registered models in the platform.

Parameters:

data (V1ModelRepoDeleteArtifactJob) – Instance containing information about artifact to delete

Returns:

The response from artifact deletion.

Return type:

Union[VianaiSuccessResponse, VianaiErrorResponse]

delete_artifact_post_url = '/v1/model_repo/delete_artifact'
export_model_get_url = '/v1/model_repo/export/{run_id}'
export_run(run_id: str) None

Export models from the platform. This will generate a zip file that contains everything known about the model.

Parameters:

run_id (str) – The run id of model to be exported.

Return type:

None

get_meta(data: V1ModelRepoGetMetaJob, output_type: str = 'object') VianaiSuccessResponse | VianaiErrorResponse

Retrieve meta information for registered models in the platform.

Parameters:

data (V1ModelRepoGetMetaJob) – Instance containing information about metadata to retrieve.

Returns:

The response containing the retrieved metadata.

Return type:

Union[VianaiSuccessResponse, VianaiErrorResponse]

get_meta_post_url = '/v1/model_repo/get_meta'

vianops_client.api.jobmaker.model_deployment

class ModelDeploymentV1Api(config: Config | None = None)

Bases: ConfiguredBaseApiClass

create_placeholder(data: V1PlaceholderDeployment) V1PlaceholderDeploymentResponse

Create placeholder deployment

Parameters:

data (V1PlaceholderDeployment) – Instance containing the data to create placeholder deployment.

Returns:

Instance containing information about the created placeholder deployment.

Return type:

V1PlaceholderDeploymentResponse

vianops_client.api.jobmaker.modelperformance

class ModelPerformanceV1Api(config: Config | None = None)

Bases: JobApiBaseClass

cancel(job_model_or_id: str | V1JobModel, override=False) VianaiSuccessResponse

Cancel an in-progress model performance job

Parameters:
  • job_model_or_id (Union[V1JobModel, str]) – The job model or job id to be canceled.

  • override (bool) – If True, forcefully cancel the job. Default: False.

Returns:

The response from the job cancellation request.

Return type:

VianaiSuccessResponse

cancel_url = '/v1/modelperformance/cancel'
status(job_model_or_id: str | V1JobModel) V1JobModel

Retrieve model performance job status

Parameters:

job_model_or_id (Union[V1JobModel, str]) – The job model or job id for which to get the status.

Returns:

The job model containing information about the job’s current status.

Return type:

V1JobModel

status_url = '/v1/modelperformance/status'
submit(data: V1ModelPerformanceJob, wait: bool = True) V1JobModel

Submit a model performamce job

Parameters:
  • data (V1ModelPerformanceJob) – Instance containing information for the job submission.

  • wait (bool) – If True, wait for the job to complete, return all details, including job results, will be returned; otherwise, incomplete job submission details will be return. Default: True.

Returns:

The response from the job submission.

Return type:

V1JobModel

submit_url = '/v1/modelperformance/submit'

vianops_client.api.jobmaker.preprocessing

class PreprocessingV1Api(config: Config | None = None)

Bases: JobApiBaseClass

cancel(job_id)

Cancel an in-progress preprocessing job

Parameters:

job_id (str) – The id of the job to be canceled.

Returns:

The response from the job cancellation request.

Return type:

str

cancel_url = '/v1/preprocessing/cancel'
status(job_id)

Retrieve preprocessing job status

Parameters:

job_id (str) – The job id for which to get the status.

Returns:

The job’s current status.

Return type:

dict

status_url = '/v1/preprocessing/status'
submit(data: V1PreprocessingJoinJob | V1PreprocessingJob | V1PreprocessingTrainingJob, wait: bool = True)

Submit a preprocessing or join preprocessing job

Parameters:
  • data (Union[V1PreprocessingJoinJob, V1PreprocessingJob]) – Instance containing information for the job submission.

  • wait (bool) – If True, wait for the job to complete, return all details, including job results, will be returned; otherwise, incomplete job submission details will be return. Default: True.

Returns:

The response from the job submission.

Return type:

V1JobModel

submit_url = '/v1/preprocessing/submit'

vianops_client.api.jobmaker.util

class JobApiBaseClass(config: Config | None = None)

Bases: ConfiguredBaseApiClass

wait_for_job(job_info: str | V1JobModel, status_url_subdir: str)
wait_for_jobs(job_ids, status_url, num_threads=15)