aistore.sdk.job
Module Contents
Classes
Data
API
A class containing job-related functions.
Parameters:
Client for interfacing with AIS cluster
ID of a specific job, empty for all jobs
Specific kind of job, empty for all kinds
Return job id
Return job kind
Retrieve detailed job snapshot information across all targets.
Returns: AggregatedJobSnap
A snapshot containing detailed metrics for the job.
Calculates the total job duration as the difference between the earliest start time and the latest end time among all job snapshots. If any snapshot is missing an end_time, returns None to indicate the job is incomplete.
Returns: Optional[timedelta]
Optional[timedelta]: The total duration of the job, or None if incomplete.
Retrieves jobs that started after a specified start_time and optionally ended before a specified end_time.
Parameters:
The start of the timeframe for monitoring jobs.
The end of the timeframe for monitoring jobs.
Returns: List[JobSnap]
List[JobSnapshot]: A list of jobs that meet the specified timeframe criteria.
Raises:
JobInfoNotFound: Raised when no relevant job info is found.
Start a job and return its ID.
Parameters:
For running a job that must run on a specific target node (e.g. resilvering).
Override existing restrictions for a bucket (e.g., run LRU eviction even if the bucket has LRU disabled).
List of one or more buckets; applicable only for jobs that have bucket
scope (for details on job types, see Table in xact/api.go).
Returns: str
The running job ID.
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStore
Return status of a job
Returns: JobStatus
The job status including id, finish time, and error info
Raises:
ValueError: If the job does not have an assigned IDrequests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStore
Wait for a job to finish
Parameters:
The maximum time to wait for the job, in seconds. Default timeout is 5 minutes.
Whether to log wait status to standard output
Returns: WaitResult
Outcome of the wait operation
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStoreerrors.Timeout: Timeout while waiting for the job to finish
Wait for a job to reach an idle state
Parameters:
The maximum time to wait for the job, in seconds. Default timeout is 5 minutes.
Whether to log wait status to standard output
Returns: WaitResult
Outcome of the wait operation
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStoreerrors.Timeout: Timeout while waiting for the job to finish
Wait for a job running on a single node
Parameters:
The maximum time to wait for the job, in seconds. Default timeout is 5 minutes.
Whether to log wait status to standard output
Returns: WaitResult
Outcome of the wait operation
Raises:
requests.RequestException: “There was an ambiguous exception that occurred while handling…”requests.ConnectionError: Connection errorrequests.ConnectionTimeout: Timed out connecting to AIStorerequests.ReadTimeout: Timed out waiting response from AIStoreerrors.Timeout: Timeout while waiting for the job to finish