provenaclient.clients.job_client

Created Date: Monday June 17th 2024 +1000 Author: Peter Baker —– Last Modified: Monday June 17th 2024 4:45:39 pm +1000 Modified By: Peter Baker —– Description: Job API L2 Client. —– HISTORY: Date By Comments ———- — ———————————————————

Classes

JobAPIAdminEndpoints

An ENUM containing the job api endpoints.

JobAPIEndpoints

An ENUM containing the job api endpoints.

JobAPIAdminSubClient

This class interface just captures that the client has an instantiated auth

JobAPIClient

This class interface just captures that the client has an instantiated auth

Module Contents

class provenaclient.clients.job_client.JobAPIAdminEndpoints[source]

Bases: str, ProvenaInterfaces.AsyncJobAPI.Enum

An ENUM containing the job api endpoints.

POST_JOBS_ADMIN_LAUNCH = '/jobs/admin/launch'
GET_JOBS_ADMIN_FETCH = '/jobs/admin/fetch'
POST_JOBS_ADMIN_LIST = '/jobs/admin/list'
POST_JOBS_ADMIN_LIST_BATCH = '/jobs/admin/list_batch'
GET_ADMIN_CONFIG = '/admin/config'
GET_ADMIN_SENTRY_DEBUG = '/admin/sentry-debug'
class provenaclient.clients.job_client.JobAPIEndpoints[source]

Bases: str, ProvenaInterfaces.AsyncJobAPI.Enum

An ENUM containing the job api endpoints.

GET_JOBS_USER_FETCH = '/jobs/user/fetch'
POST_JOBS_USER_LIST = '/jobs/user/list'
POST_JOBS_USER_LIST_BATCH = '/jobs/user/list_batch'
GET_HEALTH_CHECK = '/'
GET_CHECK_ACCESS_CHECK_GENERAL_ACCESS = '/check-access/check-general-access'
GET_CHECK_ACCESS_CHECK_ADMIN_ACCESS = '/check-access/check-admin-access'
GET_CHECK_ACCESS_CHECK_READ_ACCESS = '/check-access/check-read-access'
GET_CHECK_ACCESS_CHECK_WRITE_ACCESS = '/check-access/check-write-access'
class provenaclient.clients.job_client.JobAPIAdminSubClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[source]

Bases: provenaclient.clients.client_helpers.ClientService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L2 clients.

_auth
_config
_build_endpoint(endpoint: JobAPIAdminEndpoints) str[source]
async launch_job(request: ProvenaInterfaces.AsyncJobAPI.AdminLaunchJobRequest) ProvenaInterfaces.AsyncJobAPI.AdminLaunchJobResponse[source]

Launches a new job.

Parameters:

request (AdminLaunchJobRequest) – Specified job parameters

Returns:

The response

Return type:

AdminLaunchJobResponse

async get_job(session_id: str) ProvenaInterfaces.AsyncJobAPI.AdminGetJobResponse[source]

Fetches a job (any job since admin)

Parameters:

session_id (str) – The session ID of job to fetch

Returns:

The response

Return type:

AdminGetJobResponse

async list_jobs(list_jobs_request: ProvenaInterfaces.AsyncJobAPI.AdminListJobsRequest) ProvenaInterfaces.AsyncJobAPI.AdminListJobsResponse[source]

Lists all jobs.

Parameters:

list_jobs_request (AdminListJobsRequest) – The request including pagination information.

Returns:

The list of jobs response.

Return type:

AdminListJobsResponse

async list_jobs_in_batch(list_request: ProvenaInterfaces.AsyncJobAPI.AdminListByBatchRequest) ProvenaInterfaces.AsyncJobAPI.AdminListByBatchResponse[source]

List jobs by batch ID, returning a list of jobs in the batch.

Parameters:

list_request (AdminListByBatchRequest) – The request including batch ID

Returns:

The list of jobs in the batch

Return type:

AdminListByBatchResponse

class provenaclient.clients.job_client.JobAPIClient(auth: provenaclient.clients.client_helpers.AuthManager, config: provenaclient.clients.client_helpers.Config)[source]

Bases: provenaclient.clients.client_helpers.ClientService

This class interface just captures that the client has an instantiated auth manager which allows for helper functions abstracted for L2 clients.

admin: JobAPIAdminSubClient
_auth
_config
_build_endpoint(endpoint: JobAPIEndpoints) str[source]
async get_health_check() provenaclient.models.HealthCheckResponse[source]

Health check the API

Returns:

Response

Return type:

HealthCheckResponse

async fetch_job(session_id: str) ProvenaInterfaces.AsyncJobAPI.GetJobResponse[source]

Fetches a job by session id

Parameters:

session_id (str) – The session ID

Returns:

The job fetched

Return type:

GetJobResponse

async list_jobs(list_jobs_request: ProvenaInterfaces.AsyncJobAPI.ListJobsRequest) ProvenaInterfaces.AsyncJobAPI.ListJobsResponse[source]

Lists all jobs for the given user

Parameters:

list_jobs_request (ListJobsRequest) – The request including details

Returns:

The list of jobs

Return type:

ListJobsResponse

async list_jobs_in_batch(list_request: ProvenaInterfaces.AsyncJobAPI.ListByBatchRequest) ProvenaInterfaces.AsyncJobAPI.ListByBatchResponse[source]

Gets all jobs within a batch.

Parameters:

list_request (ListByBatchRequest) – The request including batch ID

Returns:

The response including list of jobs

Return type:

ListByBatchResponse