Skip to main content

jobs

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

Overview

Namejobs
TypeResource
Idgoogle.transcoder.jobs

Fields

NameDatatypeDescription
namestringThe resource name of the job. Format: projects/{project_number}/locations/{location}/jobs/{job}
batchModePriorityintegerThe 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.
configobjectJob configuration
createTimestringOutput only. The time the job was created.
endTimestringOutput only. The time the transcoding finished.
errorobjectThe Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
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.
startTimestringOutput 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}
ttlAfterCompletionDaysintegerJob 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

NameAccessible byRequired ParamsDescription
getSELECTjobsId, locationsId, projectsIdReturns the job data.
listSELECTlocationsId, projectsIdLists jobs in the specified region.
createINSERTlocationsId, projectsIdCreates a job in the specified region.
deleteDELETEjobsId, locationsId, projectsIdDeletes a job.

SELECT examples

Lists jobs in the specified region.

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

INSERT example

Use the following StackQL query and manifest file to create a new jobs resource.

/*+ create */
INSERT INTO google.transcoder.jobs (
locationsId,
projectsId,
name,
inputUri,
outputUri,
templateId,
config,
ttlAfterCompletionDays,
labels,
mode,
batchModePriority,
optimization
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ inputUri }}',
'{{ outputUri }}',
'{{ templateId }}',
'{{ config }}',
'{{ ttlAfterCompletionDays }}',
'{{ labels }}',
'{{ mode }}',
'{{ batchModePriority }}',
'{{ optimization }}'
;

DELETE example

Deletes the specified jobs resource.

/*+ delete */
DELETE FROM google.transcoder.jobs
WHERE jobsId = '{{ jobsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';