Skip to main content

jobs

Creates, updates, deletes, gets or lists a jobs resource.

Overview

Namejobs
TypeResource
Idgoogle.ml.jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
createTimestring (google-datetime)Output only. When the job was created.
endTimestring (google-datetime)Output only. When the job processing was completed.
errorMessagestringOutput only. The details of a failure or a cancellation.
etagstring (byte)etag is used for optimistic concurrency control as a way to help prevent simultaneous updates of a job from overwriting each other. It is strongly suggested that systems make use of the etag in the read-modify-write cycle to perform job updates in order to avoid race conditions: An etag is returned in the response to GetJob, and systems are expected to put that etag in the request to UpdateJob to ensure that their change will be applied to the same version of the job.
jobIdstringRequired. The user-specified id of the job.
jobPositionstring (int64)Output only. It's only effect when the job is in QUEUED state. If it's positive, it indicates the job's position in the job scheduler. It's 0 when the job is already scheduled.
labelsobjectOptional. One or more labels that you can add, to organize your jobs. Each label is a key-value pair, where both the key and the value are arbitrary strings that you supply. For more information, see the documentation on using labels.
predictionInputobjectInput parameters to create a prediction job. (id: GoogleCloudMlV1__PredictionInput)
predictionOutputobjectThe current prediction job result. (id: GoogleCloudMlV1__PredictionOutput)
startTimestring (google-datetime)Output only. When the job processing was started.
statestringOutput only. The detailed state of a job.
trainingInputobjectInput parameters to create a training job. (id: GoogleCloudMlV1__TrainingInput)
trainingOutputobjectThe current training job result. (id: GoogleCloudMlV1__TrainingOutput)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_jobs_getselectprojectsId, jobsIdDescribes a job.
projects_jobs_listselectprojectsIdfilter, pageToken, pageSizeLists the jobs in the project. If there are no jobs that match the request parameters, the list request returns an empty response body: {}.
projects_jobs_createinsertprojectsIdCreates a training or a batch prediction job.
projects_jobs_patchupdateprojectsId, jobsIdupdateMaskUpdates a specific job resource. Currently the only supported fields to update are labels.
projects_jobs_cancelexecprojectsId, jobsIdCancels a running job.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
jobsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Describes a job.

SELECT
createTime,
endTime,
errorMessage,
etag,
jobId,
jobPosition,
labels,
predictionInput,
predictionOutput,
startTime,
state,
trainingInput,
trainingOutput
FROM google.ml.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND jobsId = '{{ jobsId }}' -- required;

INSERT examples

Creates a training or a batch prediction job.

INSERT INTO google.ml.jobs (
data__jobId,
data__trainingInput,
data__predictionInput,
data__createTime,
data__startTime,
data__endTime,
data__state,
data__errorMessage,
data__trainingOutput,
data__predictionOutput,
data__labels,
data__etag,
projectsId
)
SELECT
'{{ jobId }}',
'{{ trainingInput }}',
'{{ predictionInput }}',
'{{ createTime }}',
'{{ startTime }}',
'{{ endTime }}',
'{{ state }}',
'{{ errorMessage }}',
'{{ trainingOutput }}',
'{{ predictionOutput }}',
'{{ labels }}',
'{{ etag }}',
'{{ projectsId }}'
RETURNING
createTime,
endTime,
errorMessage,
etag,
jobId,
jobPosition,
labels,
predictionInput,
predictionOutput,
startTime,
state,
trainingInput,
trainingOutput
;

UPDATE examples

Updates a specific job resource. Currently the only supported fields to update are labels.

UPDATE google.ml.jobs
SET
data__jobId = '{{ jobId }}',
data__trainingInput = '{{ trainingInput }}',
data__predictionInput = '{{ predictionInput }}',
data__createTime = '{{ createTime }}',
data__startTime = '{{ startTime }}',
data__endTime = '{{ endTime }}',
data__state = '{{ state }}',
data__errorMessage = '{{ errorMessage }}',
data__trainingOutput = '{{ trainingOutput }}',
data__predictionOutput = '{{ predictionOutput }}',
data__labels = '{{ labels }}',
data__etag = '{{ etag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND jobsId = '{{ jobsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
createTime,
endTime,
errorMessage,
etag,
jobId,
jobPosition,
labels,
predictionInput,
predictionOutput,
startTime,
state,
trainingInput,
trainingOutput;

Lifecycle Methods

Cancels a running job.

EXEC google.ml.jobs.projects_jobs_cancel 
@projectsId='{{ projectsId }}' --required,
@jobsId='{{ jobsId }}' --required;