create method
Creates a Cloud Dataflow job.
To create a job, we recommend using projects.locations.jobs.create
with
a
regional endpoint.
Using projects.jobs.create
is not recommended, as your job will always
start in us-central1
. Do not enter confidential information when you
supply string values using the API.
request
- The metadata request object.
Request parameters:
projectId
- The ID of the Cloud Platform project that the job belongs
to.
location
- The
regional endpoint
that contains this job.
replaceJobId
- Deprecated. This field is now in the Job message.
view
- The level of information requested in response.
Possible string values are:
- "JOB_VIEW_UNKNOWN" : The job view to return isn't specified, or is
unknown. Responses will contain at least the
JOB_VIEW_SUMMARY
information, and may contain additional information. - "JOB_VIEW_SUMMARY" : Request summary information only: Project ID, Job ID, job name, job type, job status, start/end time, and Cloud SDK version details.
- "JOB_VIEW_ALL" : Request all information available for this job. When
the job is in
JOB_STATE_PENDING
, the job has been created but is not yet running, and not all job information is available. For complete job information, wait until the job in isJOB_STATE_RUNNING
. For more information, see JobState. - "JOB_VIEW_DESCRIPTION" : Request summary info and limited job description data for steps, labels and environment.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Job.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Job> create(
Job request,
core.String projectId, {
core.String? location,
core.String? replaceJobId,
core.String? view,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (location != null) 'location': [location],
if (replaceJobId != null) 'replaceJobId': [replaceJobId],
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final url_ =
'v1b3/projects/' + commons.escapeVariable('$projectId') + '/jobs';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Job.fromJson(response_ as core.Map<core.String, core.dynamic>);
}