Method: projects.templates.create

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. Using projects.templates.create is not recommended, because your job will always start in us-central1.

IAM Permissions

Requires the following IAM permission(s) on the project:

  • dataflow.jobs.create
  • resourcemanager.projects.get

HTTP request


POST https://dataflow.googleapis.com/v1b3/projects/{projectId}/templates

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
projectId

string

Required. The ID of the Cloud Platform project that the job belongs to.

Request body

The request body contains data with the following structure:

JSON representation
{
  "jobName": string,
  "parameters": {
    string: string,
    ...
  },
  "environment": {
    object (RuntimeEnvironment)
  },
  "location": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "gcsPath": string
  // End of mutually exclusive fields.
}
Fields
jobName

string

Required. The job name to use for the created job.

parameters

map (key: string, value: string)

The runtime parameters to pass to the job.

environment

object (RuntimeEnvironment)

The runtime environment for the job.

location

string

The regional endpoint to which to direct the request.

The template from which to create the job. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
gcsPath

string

Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with gs://.

End of mutually exclusive fields.

Response body

If successful, the response body contains a newly created instance of Job.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.