Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idgoogle.transcoder.jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe resource name of the job. Format: projects/{project_number}/locations/{location}/jobs/{job}
batchModePriorityinteger (int32)The processing priority of a batch job. This field can only be set for batch mode jobs. The default value is 0. This value cannot be negative. Higher values correspond to higher priorities for the job.
configobjectThe configuration for this job. (id: JobConfig)
createTimestring (google-datetime)Output only. The time the job was created.
endTimestring (google-datetime)Output only. The time the transcoding finished.
errorobjectOutput only. An error object that describes the reason for the failure. This property is always present when ProcessingState is FAILED. (id: Status)
fillContentGapsbooleanOptional. Insert silence and duplicate frames when timestamp gaps are detected in a given stream.
inputUristringInput only. Specify the input_uri to populate empty uri fields in each element of Job.config.inputs or JobTemplate.config.inputs when using template. URI of the media. Input files must be at least 5 seconds in duration and stored in Cloud Storage (for example, gs://bucket/inputs/file.mp4). See Supported input and output formats.
labelsobjectThe labels associated with this job. You can use these to organize and group your jobs.
modestringThe processing mode of the job. The default is PROCESSING_MODE_INTERACTIVE.
optimizationstringOptional. The optimization strategy of the job. The default is AUTODETECT.
outputUristringInput only. Specify the output_uri to populate an empty Job.config.output.uri or JobTemplate.config.output.uri when using template. URI for the output file(s). For example, gs://my-bucket/outputs/. See Supported input and output formats.
startTimestring (google-datetime)Output only. The time the transcoding started.
statestringOutput only. The current state of the job.
templateIdstringInput only. Specify the template_id to use for populating Job.config. The default is preset/web-hd, which is the only supported preset. User defined JobTemplate: {job_template_id}
ttlAfterCompletionDaysinteger (int32)Job time to live value in days, which will be effective after job completion. Job should be deleted automatically after the given TTL. Enter a value between 1 and 90. The default is 30.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, jobsIdReturns the job data.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists jobs in the specified region.
createinsertprojectsId, locationsIdCreates a job in the specified region.
deletedeleteprojectsId, locationsId, jobsIdallowMissingDeletes a 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
locationsIdstring
projectsIdstring
allowMissingboolean
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Returns the job data.

SELECT
name,
batchModePriority,
config,
createTime,
endTime,
error,
fillContentGaps,
inputUri,
labels,
mode,
optimization,
outputUri,
startTime,
state,
templateId,
ttlAfterCompletionDays
FROM google.transcoder.jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND jobsId = '{{ jobsId }}' -- required;

INSERT examples

Creates a job in the specified region.

INSERT INTO google.transcoder.jobs (
data__name,
data__inputUri,
data__outputUri,
data__templateId,
data__config,
data__ttlAfterCompletionDays,
data__labels,
data__mode,
data__batchModePriority,
data__optimization,
data__fillContentGaps,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ inputUri }}',
'{{ outputUri }}',
'{{ templateId }}',
'{{ config }}',
{{ ttlAfterCompletionDays }},
'{{ labels }}',
'{{ mode }}',
{{ batchModePriority }},
'{{ optimization }}',
{{ fillContentGaps }},
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
batchModePriority,
config,
createTime,
endTime,
error,
fillContentGaps,
inputUri,
labels,
mode,
optimization,
outputUri,
startTime,
state,
templateId,
ttlAfterCompletionDays
;

DELETE examples

Deletes a job.

DELETE FROM google.transcoder.jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND jobsId = '{{ jobsId }}' --required
AND allowMissing = '{{ allowMissing }}';