jobs
Creates, updates, deletes, gets or lists a jobs resource.
Overview
| Name | jobs |
| Type | Resource |
| Id | google.ml.jobs |
Fields
The following fields are returned by SELECT queries:
- projects_jobs_get
- projects_jobs_list
| Name | Datatype | Description |
|---|---|---|
createTime | string (google-datetime) | Output only. When the job was created. |
endTime | string (google-datetime) | Output only. When the job processing was completed. |
errorMessage | string | Output only. The details of a failure or a cancellation. |
etag | string (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. |
jobId | string | Required. The user-specified id of the job. |
jobPosition | string (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. |
labels | object | Optional. 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. |
predictionInput | object | Input parameters to create a prediction job. (id: GoogleCloudMlV1__PredictionInput) |
predictionOutput | object | The current prediction job result. (id: GoogleCloudMlV1__PredictionOutput) |
startTime | string (google-datetime) | Output only. When the job processing was started. |
state | string | Output only. The detailed state of a job. |
trainingInput | object | Input parameters to create a training job. (id: GoogleCloudMlV1__TrainingInput) |
trainingOutput | object | The current training job result. (id: GoogleCloudMlV1__TrainingOutput) |
| Name | Datatype | Description |
|---|---|---|
createTime | string (google-datetime) | Output only. When the job was created. |
endTime | string (google-datetime) | Output only. When the job processing was completed. |
errorMessage | string | Output only. The details of a failure or a cancellation. |
etag | string (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. |
jobId | string | Required. The user-specified id of the job. |
jobPosition | string (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. |
labels | object | Optional. 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. |
predictionInput | object | Input parameters to create a prediction job. (id: GoogleCloudMlV1__PredictionInput) |
predictionOutput | object | The current prediction job result. (id: GoogleCloudMlV1__PredictionOutput) |
startTime | string (google-datetime) | Output only. When the job processing was started. |
state | string | Output only. The detailed state of a job. |
trainingInput | object | Input parameters to create a training job. (id: GoogleCloudMlV1__TrainingInput) |
trainingOutput | object | The current training job result. (id: GoogleCloudMlV1__TrainingOutput) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_jobs_get | select | projectsId, jobsId | Describes a job. | |
projects_jobs_list | select | projectsId | filter, pageToken, pageSize | Lists 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_create | insert | projectsId | Creates a training or a batch prediction job. | |
projects_jobs_patch | update | projectsId, jobsId | updateMask | Updates a specific job resource. Currently the only supported fields to update are labels. |
projects_jobs_cancel | exec | projectsId, jobsId | Cancels 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.
| Name | Datatype | Description |
|---|---|---|
jobsId | string | |
projectsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- projects_jobs_get
- projects_jobs_list
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
;
Lists the jobs in the project. If there are no jobs that match the request parameters, the list request returns an empty response body: {}.
SELECT
createTime,
endTime,
errorMessage,
etag,
jobId,
jobPosition,
labels,
predictionInput,
predictionOutput,
startTime,
state,
trainingInput,
trainingOutput
FROM google.ml.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND filter = '{{ filter }}'
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
;
INSERT examples
- projects_jobs_create
- Manifest
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
;
# Description fields are for documentation purposes
- name: jobs
props:
- name: projectsId
value: string
description: Required parameter for the jobs resource.
- name: jobId
value: string
description: >
Required. The user-specified id of the job.
- name: trainingInput
value: object
description: >
Input parameters to create a training job.
- name: predictionInput
value: object
description: >
Input parameters to create a prediction job.
- name: createTime
value: string
description: >
Output only. When the job was created.
- name: startTime
value: string
description: >
Output only. When the job processing was started.
- name: endTime
value: string
description: >
Output only. When the job processing was completed.
- name: state
value: string
description: >
Output only. The detailed state of a job.
valid_values: ['STATE_UNSPECIFIED', 'QUEUED', 'PREPARING', 'RUNNING', 'SUCCEEDED', 'FAILED', 'CANCELLING', 'CANCELLED']
- name: errorMessage
value: string
description: >
Output only. The details of a failure or a cancellation.
- name: trainingOutput
value: object
description: >
The current training job result.
- name: predictionOutput
value: object
description: >
The current prediction job result.
- name: labels
value: object
description: >
Optional. 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.
- name: etag
value: string
description: >
`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.
UPDATE examples
- projects_jobs_patch
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
- projects_jobs_cancel
Cancels a running job.
EXEC google.ml.jobs.projects_jobs_cancel
@projectsId='{{ projectsId }}' --required,
@jobsId='{{ jobsId }}' --required
;