templates
Creates, updates, deletes, gets or lists a templates resource.
Overview
| Name | templates |
| Type | Resource |
| Id | google.dataflow.templates |
Fields
The following fields are returned by SELECT queries:
- projects_locations_templates_get
- projects_templates_get
| Name | Datatype | Description |
|---|---|---|
metadata | object | The template metadata describing the template name, available parameters, etc. (id: TemplateMetadata) |
runtimeMetadata | object | Describes the runtime metadata with SDKInfo and available parameters. (id: RuntimeMetadata) |
status | object | The status of the get template request. Any problems with the request will be indicated in the error_details. (id: Status) |
templateType | string | Template Type. (UNKNOWN, LEGACY, FLEX) |
| Name | Datatype | Description |
|---|---|---|
metadata | object | The template metadata describing the template name, available parameters, etc. (id: TemplateMetadata) |
runtimeMetadata | object | Describes the runtime metadata with SDKInfo and available parameters. (id: RuntimeMetadata) |
status | object | The status of the get template request. Any problems with the request will be indicated in the error_details. (id: Status) |
templateType | string | Template Type. (UNKNOWN, LEGACY, FLEX) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
projects_locations_templates_get | select | projectId, location | gcsPath, view | Get the template associated with a template. To get the template, we recommend using projects.locations.templates.get with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.get is not recommended, because only templates that are running in us-central1 are retrieved. |
projects_templates_get | select | projectId | gcsPath, location, view | Get the template associated with a template. To get the template, we recommend using projects.locations.templates.get with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.get is not recommended, because only templates that are running in us-central1 are retrieved. |
projects_locations_templates_create | insert | projectId, location | Creates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API. To create a job, we recommend using projects.locations.templates.create with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.create is not recommended, because your job will always start in us-central1. | |
projects_templates_create | insert | projectId | Creates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API. To create a job, we recommend using projects.locations.templates.create with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.create is not recommended, because your job will always start in us-central1. | |
projects_locations_templates_launch | exec | projectId, location | validateOnly, gcsPath, dynamicTemplate.gcsPath, dynamicTemplate.stagingLocation | Launches a template. To launch a template, we recommend using projects.locations.templates.launch with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.launch is not recommended, because jobs launched from the template will always start in us-central1. |
projects_templates_launch | exec | projectId | dynamicTemplate.stagingLocation, location, validateOnly, gcsPath, dynamicTemplate.gcsPath | Launches a template. To launch a template, we recommend using projects.locations.templates.launch with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.launch is not recommended, because jobs launched from the template will always start in us-central1. |
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 |
|---|---|---|
location | string | |
projectId | string | |
dynamicTemplate.gcsPath | string | |
dynamicTemplate.stagingLocation | string | |
gcsPath | string | |
location | string | |
validateOnly | boolean | |
view | string |
SELECT examples
- projects_locations_templates_get
- projects_templates_get
Get the template associated with a template. To get the template, we recommend using projects.locations.templates.get with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.get is not recommended, because only templates that are running in us-central1 are retrieved.
SELECT
metadata,
runtimeMetadata,
status,
templateType
FROM google.dataflow.templates
WHERE projectId = '{{ projectId }}' -- required
AND location = '{{ location }}' -- required
AND gcsPath = '{{ gcsPath }}'
AND view = '{{ view }}'
;
Get the template associated with a template. To get the template, we recommend using projects.locations.templates.get with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.get is not recommended, because only templates that are running in us-central1 are retrieved.
SELECT
metadata,
runtimeMetadata,
status,
templateType
FROM google.dataflow.templates
WHERE projectId = '{{ projectId }}' -- required
AND gcsPath = '{{ gcsPath }}'
AND location = '{{ location }}'
AND view = '{{ view }}'
;
INSERT examples
- projects_locations_templates_create
- projects_templates_create
- Manifest
Creates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API. To create a job, we recommend using projects.locations.templates.create with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.create is not recommended, because your job will always start in us-central1.
INSERT INTO google.dataflow.templates (
data__gcsPath,
data__environment,
data__location,
data__jobName,
data__parameters,
projectId,
location
)
SELECT
'{{ gcsPath }}',
'{{ environment }}',
'{{ location }}',
'{{ jobName }}',
'{{ parameters }}',
'{{ projectId }}',
'{{ location }}'
RETURNING
id,
name,
clientRequestId,
createTime,
createdFromSnapshotId,
currentState,
currentStateTime,
environment,
executionInfo,
jobMetadata,
labels,
location,
pausable,
pipelineDescription,
projectId,
replaceJobId,
replacedByJobId,
requestedState,
runtimeUpdatableParams,
satisfiesPzi,
satisfiesPzs,
serviceResources,
stageStates,
startTime,
steps,
stepsLocation,
tempFiles,
transformNameMapping,
type
;
Creates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API. To create a job, we recommend using projects.locations.templates.create with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.create is not recommended, because your job will always start in us-central1.
INSERT INTO google.dataflow.templates (
data__gcsPath,
data__environment,
data__location,
data__jobName,
data__parameters,
projectId
)
SELECT
'{{ gcsPath }}',
'{{ environment }}',
'{{ location }}',
'{{ jobName }}',
'{{ parameters }}',
'{{ projectId }}'
RETURNING
id,
name,
clientRequestId,
createTime,
createdFromSnapshotId,
currentState,
currentStateTime,
environment,
executionInfo,
jobMetadata,
labels,
location,
pausable,
pipelineDescription,
projectId,
replaceJobId,
replacedByJobId,
requestedState,
runtimeUpdatableParams,
satisfiesPzi,
satisfiesPzs,
serviceResources,
stageStates,
startTime,
steps,
stepsLocation,
tempFiles,
transformNameMapping,
type
;
# Description fields are for documentation purposes
- name: templates
props:
- name: projectId
value: "{{ projectId }}"
description: Required parameter for the templates resource.
- name: location
value: "{{ location }}"
description: Required parameter for the templates resource.
- name: gcsPath
value: "{{ gcsPath }}"
description: |
Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`.
- name: environment
description: |
The runtime environment for the job.
value:
maxWorkers: {{ maxWorkers }}
additionalPipelineOptions:
- "{{ additionalPipelineOptions }}"
serviceAccountEmail: "{{ serviceAccountEmail }}"
subnetwork: "{{ subnetwork }}"
workerRegion: "{{ workerRegion }}"
enableStreamingEngine: {{ enableStreamingEngine }}
tempLocation: "{{ tempLocation }}"
bypassTempDirValidation: {{ bypassTempDirValidation }}
kmsKeyName: "{{ kmsKeyName }}"
additionalExperiments:
- "{{ additionalExperiments }}"
network: "{{ network }}"
zone: "{{ zone }}"
machineType: "{{ machineType }}"
numWorkers: {{ numWorkers }}
additionalUserLabels: "{{ additionalUserLabels }}"
ipConfiguration: "{{ ipConfiguration }}"
diskSizeGb: {{ diskSizeGb }}
workerZone: "{{ workerZone }}"
streamingMode: "{{ streamingMode }}"
- name: location
value: "{{ location }}"
description: |
The [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which to direct the request.
- name: jobName
value: "{{ jobName }}"
description: |
Required. The job name to use for the created job.
- name: parameters
value: "{{ parameters }}"
description: |
The runtime parameters to pass to the job.
Lifecycle Methods
- projects_locations_templates_launch
- projects_templates_launch
Launches a template. To launch a template, we recommend using projects.locations.templates.launch with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.launch is not recommended, because jobs launched from the template will always start in us-central1.
EXEC google.dataflow.templates.projects_locations_templates_launch
@projectId='{{ projectId }}' --required,
@location='{{ location }}' --required,
@validateOnly={{ validateOnly }},
@gcsPath='{{ gcsPath }}',
@dynamicTemplate.gcsPath='{{ dynamicTemplate.gcsPath }}',
@dynamicTemplate.stagingLocation='{{ dynamicTemplate.stagingLocation }}'
@@json=
'{
"transformNameMapping": "{{ transformNameMapping }}",
"parameters": "{{ parameters }}",
"jobName": "{{ jobName }}",
"update": {{ update }},
"environment": "{{ environment }}"
}'
;
Launches a template. To launch a template, we recommend using projects.locations.templates.launch with a [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using projects.templates.launch is not recommended, because jobs launched from the template will always start in us-central1.
EXEC google.dataflow.templates.projects_templates_launch
@projectId='{{ projectId }}' --required,
@dynamicTemplate.stagingLocation='{{ dynamicTemplate.stagingLocation }}',
@location='{{ location }}',
@validateOnly={{ validateOnly }},
@gcsPath='{{ gcsPath }}',
@dynamicTemplate.gcsPath='{{ dynamicTemplate.gcsPath }}'
@@json=
'{
"transformNameMapping": "{{ transformNameMapping }}",
"parameters": "{{ parameters }}",
"jobName": "{{ jobName }}",
"update": {{ update }},
"environment": "{{ environment }}"
}'
;