Skip to main content

custom_jobs

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

Overview

Namecustom_jobs
TypeResource
Idgoogle.aiplatform.custom_jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Resource name of a CustomJob.
createTimestring (google-datetime)Output only. Time when the CustomJob was created.
displayNamestringRequired. The display name of the CustomJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
encryptionSpecobjectCustomer-managed encryption key options for a CustomJob. If this is set, then all resources created by the CustomJob will be encrypted with the provided encryption key. (id: GoogleCloudAiplatformV1EncryptionSpec)
endTimestring (google-datetime)Output only. Time when the CustomJob entered any of the following states: JOB_STATE_SUCCEEDED, JOB_STATE_FAILED, JOB_STATE_CANCELLED.
errorobjectOutput only. Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED. (id: GoogleRpcStatus)
jobSpecobjectRequired. Job spec. (id: GoogleCloudAiplatformV1CustomJobSpec)
labelsobjectThe labels with user-defined metadata to organize CustomJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
satisfiesPzibooleanOutput only. Reserved for future use.
satisfiesPzsbooleanOutput only. Reserved for future use.
startTimestring (google-datetime)Output only. Time when the CustomJob for the first time entered the JOB_STATE_RUNNING state.
statestringOutput only. The detailed state of the job.
updateTimestring (google-datetime)Output only. Time when the CustomJob was most recently updated.
webAccessUrisobjectOutput only. URIs for accessing interactive shells (one URI for each training node). Only available if job_spec.enable_web_access is true. The keys are names of each node in the training job; for example, workerpool0-0 for the primary node, workerpool1-0 for the first node in the second worker pool, and workerpool1-1 for the second node in the second worker pool. The values are the URIs for each node's interactive shell.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, customJobsIdGets a CustomJob.
listselectprojectsId, locationsIdfilter, pageSize, pageToken, readMaskLists CustomJobs in a Location.
createinsertprojectsId, locationsIdCreates a CustomJob. A created CustomJob right away will be attempted to be run.
deletedeleteprojectsId, locationsId, customJobsIdDeletes a CustomJob.
cancelexecprojectsId, locationsId, customJobsIdCancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

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
customJobsIdstring
locationsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
readMaskstring (google-fieldmask)

SELECT examples

Gets a CustomJob.

SELECT
name,
createTime,
displayName,
encryptionSpec,
endTime,
error,
jobSpec,
labels,
satisfiesPzi,
satisfiesPzs,
startTime,
state,
updateTime,
webAccessUris
FROM google.aiplatform.custom_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND customJobsId = '{{ customJobsId }}' -- required;

INSERT examples

Creates a CustomJob. A created CustomJob right away will be attempted to be run.

INSERT INTO google.aiplatform.custom_jobs (
data__displayName,
data__jobSpec,
data__labels,
data__encryptionSpec,
projectsId,
locationsId
)
SELECT
'{{ displayName }}',
'{{ jobSpec }}',
'{{ labels }}',
'{{ encryptionSpec }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
createTime,
displayName,
encryptionSpec,
endTime,
error,
jobSpec,
labels,
satisfiesPzi,
satisfiesPzs,
startTime,
state,
updateTime,
webAccessUris
;

DELETE examples

Deletes a CustomJob.

DELETE FROM google.aiplatform.custom_jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND customJobsId = '{{ customJobsId }}' --required;

Lifecycle Methods

Cancels a CustomJob. Starts asynchronous cancellation on the CustomJob. The server makes a best effort to cancel the job, but success is not guaranteed. Clients can use JobService.GetCustomJob or other methods to check whether the cancellation succeeded or whether the job completed despite cancellation. On successful cancellation, the CustomJob is not deleted; instead it becomes a job with a CustomJob.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED, and CustomJob.state is set to CANCELLED.

EXEC google.aiplatform.custom_jobs.cancel 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@customJobsId='{{ customJobsId }}' --required;