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
Successful response
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. |
Successful response
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. |
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 , view , location | 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_templates_launch | exec | projectId | validateOnly , gcsPath , dynamicTemplate.gcsPath , dynamicTemplate.stagingLocation , location | 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_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 . |
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 view = '{{ view }}'
AND location = '{{ location }}';
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__jobName,
data__gcsPath,
data__parameters,
data__environment,
data__location,
projectId,
location
)
SELECT
'{{ jobName }}',
'{{ gcsPath }}',
'{{ parameters }}',
'{{ environment }}',
'{{ location }}',
'{{ projectId }}',
'{{ location }}'
RETURNING
id,
name,
clientRequestId,
createTime,
createdFromSnapshotId,
currentState,
currentStateTime,
environment,
executionInfo,
jobMetadata,
labels,
location,
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__jobName,
data__gcsPath,
data__parameters,
data__environment,
data__location,
projectId
)
SELECT
'{{ jobName }}',
'{{ gcsPath }}',
'{{ parameters }}',
'{{ environment }}',
'{{ location }}',
'{{ projectId }}'
RETURNING
id,
name,
clientRequestId,
createTime,
createdFromSnapshotId,
currentState,
currentStateTime,
environment,
executionInfo,
jobMetadata,
labels,
location,
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: string
description: Required parameter for the templates resource.
- name: location
value: string
description: Required parameter for the templates resource.
- name: jobName
value: string
description: >
Required. The job name to use for the created job.
- name: gcsPath
value: string
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: parameters
value: object
description: >
The runtime parameters to pass to the job.
- name: environment
value: object
description: >
The runtime environment for the job.
- name: location
value: string
description: >
The [regional endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which to direct the request.
Lifecycle Methods
- projects_templates_launch
- projects_locations_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_templates_launch
@projectId='{{ projectId }}' --required,
@validateOnly={{ validateOnly }},
@gcsPath='{{ gcsPath }}',
@dynamicTemplate.gcsPath='{{ dynamicTemplate.gcsPath }}',
@dynamicTemplate.stagingLocation='{{ dynamicTemplate.stagingLocation }}',
@location='{{ location }}'
@@json=
'{
"jobName": "{{ jobName }}",
"parameters": "{{ parameters }}",
"environment": "{{ environment }}",
"update": {{ update }},
"transformNameMapping": "{{ transformNameMapping }}"
}';
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=
'{
"jobName": "{{ jobName }}",
"parameters": "{{ parameters }}",
"environment": "{{ environment }}",
"update": {{ update }},
"transformNameMapping": "{{ transformNameMapping }}"
}';