- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- LaunchFlexTemplateParameter
- FlexTemplateRuntimeEnvironment
- Examples
- Try it!
Launch a job with a FlexTemplate.
HTTP request
POST https://dataflow.googleapis.com/v1b3/projects/{projectId}/locations/{location}/flexTemplates:launch
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
projectId |
Required. The ID of the Cloud Platform project that the job belongs to. |
location |
Required. The regional endpoint to which to direct the request. E.g., us-central1, us-west1. |
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{
"launchParameter": {
object ( |
Fields | |
---|---|
launchParameter |
Required. Parameter to launch a job form Flex Template. |
validateOnly |
If true, the request is validated but not actually executed. Defaults to false. |
Response body
If successful, the response body contains data with the following structure:
Response to the request to launch a job from Flex Template.
JSON representation | |
---|---|
{
"job": {
object ( |
Fields | |
---|---|
job |
The job that was launched, if the request was not a dry run and the job was successfully launched. |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute.readonly
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/userinfo.email
For more information, see the Authentication Overview.
LaunchFlexTemplateParameter
Launch FlexTemplate Parameter.
JSON representation | |
---|---|
{ "jobName": string, "parameters": { string: string, ... }, "launchOptions": { string: string, ... }, "environment": { object ( |
Fields | ||
---|---|---|
jobName |
Required. The job name to use for the created job. |
|
parameters |
The parameters for FlexTemplate. An object containing a list of |
|
launchOptions |
Launch options for this flex template job. This is a common set of options across languages and templates. This should not be used to pass job parameters. An object containing a list of |
|
environment |
The runtime environment for the FlexTemplate job |
|
Union field template . Launch Mechanism. template can be only one of the following: |
||
containerSpec |
Spec about the container image to launch. |
|
containerSpecGcsPath |
Gcs path to a file with json serialized ContainerSpec as content. |
FlexTemplateRuntimeEnvironment
The environment values to be set at runtime for flex template.
JSON representation | |
---|---|
{
"numWorkers": integer,
"maxWorkers": integer,
"zone": string,
"serviceAccountEmail": string,
"tempLocation": string,
"machineType": string,
"additionalExperiments": [
string
],
"network": string,
"subnetwork": string,
"additionalUserLabels": {
string: string,
...
},
"kmsKeyName": string,
"ipConfiguration": enum ( |
Fields | |
---|---|
numWorkers |
The initial number of Compute Engine instances for the job. |
maxWorkers |
The maximum number of Compute Engine instances to be made available to your pipeline during execution, from 1 to 1000. |
zone |
The Compute Engine availability zone for launching worker instances to run your pipeline. In the future, workerZone will take precedence. |
serviceAccountEmail |
The email address of the service account to run the job as. |
tempLocation |
The Cloud Storage path to use for temporary files. Must be a valid Cloud Storage URL, beginning with |
machineType |
The machine type to use for the job. Defaults to the value from the template if not specified. |
additionalExperiments[] |
Additional experiment flags for the job. |
network |
Network to which VMs will be assigned. If empty or unspecified, the service will use the network "default". |
subnetwork |
Subnetwork to which VMs will be assigned, if desired. You can specify a subnetwork using either a complete URL or an abbreviated path. Expected to be of the form "https://www.googleapis.com/compute/v1/projects/HOST_PROJECT_ID/regions/REGION/subnetworks/SUBNETWORK" or "regions/REGION/subnetworks/SUBNETWORK". If the subnetwork is located in a Shared VPC network, you must use the complete URL. |
additionalUserLabels |
Additional user labels to be specified for the job. Keys and values must follow the restrictions specified in the labeling restrictions page. An object containing a list of |
kmsKeyName |
Name for the Cloud KMS key for the job. Key format is: projects/ |
ipConfiguration |
Configuration for VM IPs. |
workerRegion |
The Compute Engine region (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in which worker processing should occur, e.g. "us-west1". Mutually exclusive with workerZone. If neither workerRegion nor workerZone is specified, default to the control plane's region. |
workerZone |
The Compute Engine zone (https://cloud.google.com/compute/docs/regions-zones/regions-zones) in which worker processing should occur, e.g. "us-west1-a". Mutually exclusive with workerRegion. If neither workerRegion nor workerZone is specified, a zone in the control plane's region is chosen based on available capacity. If both |
enableStreamingEngine |
Whether to enable Streaming Engine for the job. |