source: vendor/google/apiclient-services/src/Dataflow/Resource/ProjectsTemplates.php@ e3d4e0a

Last change on this file since e3d4e0a was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 2 weeks ago

Upload project files

  • Property mode set to 100644
File size: 5.3 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Dataflow\Resource;
19
20use Google\Service\Dataflow\CreateJobFromTemplateRequest;
21use Google\Service\Dataflow\GetTemplateResponse;
22use Google\Service\Dataflow\Job;
23use Google\Service\Dataflow\LaunchTemplateParameters;
24use Google\Service\Dataflow\LaunchTemplateResponse;
25
26/**
27 * The "templates" collection of methods.
28 * Typical usage is:
29 * <code>
30 * $dataflowService = new Google\Service\Dataflow(...);
31 * $templates = $dataflowService->projects_templates;
32 * </code>
33 */
34class ProjectsTemplates extends \Google\Service\Resource
35{
36 /**
37 * Creates a Cloud Dataflow job from a template. Do not enter confidential
38 * information when you supply string values using the API. To create a job, we
39 * recommend using `projects.locations.templates.create` with a [regional
40 * endpoint] (https://cloud.google.com/dataflow/docs/concepts/regional-
41 * endpoints). Using `projects.templates.create` is not recommended, because
42 * your job will always start in `us-central1`. (templates.create)
43 *
44 * @param string $projectId Required. The ID of the Cloud Platform project that
45 * the job belongs to.
46 * @param CreateJobFromTemplateRequest $postBody
47 * @param array $optParams Optional parameters.
48 * @return Job
49 * @throws \Google\Service\Exception
50 */
51 public function create($projectId, CreateJobFromTemplateRequest $postBody, $optParams = [])
52 {
53 $params = ['projectId' => $projectId, 'postBody' => $postBody];
54 $params = array_merge($params, $optParams);
55 return $this->call('create', [$params], Job::class);
56 }
57 /**
58 * Get the template associated with a template. To get the template, we
59 * recommend using `projects.locations.templates.get` with a [regional endpoint]
60 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
61 * `projects.templates.get` is not recommended, because only templates that are
62 * running in `us-central1` are retrieved. (templates.get)
63 *
64 * @param string $projectId Required. The ID of the Cloud Platform project that
65 * the job belongs to.
66 * @param array $optParams Optional parameters.
67 *
68 * @opt_param string gcsPath Required. A Cloud Storage path to the template from
69 * which to create the job. Must be valid Cloud Storage URL, beginning with
70 * 'gs://'.
71 * @opt_param string location The [regional endpoint]
72 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which
73 * to direct the request.
74 * @opt_param string view The view to retrieve. Defaults to METADATA_ONLY.
75 * @return GetTemplateResponse
76 * @throws \Google\Service\Exception
77 */
78 public function get($projectId, $optParams = [])
79 {
80 $params = ['projectId' => $projectId];
81 $params = array_merge($params, $optParams);
82 return $this->call('get', [$params], GetTemplateResponse::class);
83 }
84 /**
85 * Launches a template. To launch a template, we recommend using
86 * `projects.locations.templates.launch` with a [regional endpoint]
87 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using
88 * `projects.templates.launch` is not recommended, because jobs launched from
89 * the template will always start in `us-central1`. (templates.launch)
90 *
91 * @param string $projectId Required. The ID of the Cloud Platform project that
92 * the job belongs to.
93 * @param LaunchTemplateParameters $postBody
94 * @param array $optParams Optional parameters.
95 *
96 * @opt_param string dynamicTemplate.gcsPath Path to the dynamic template
97 * specification file on Cloud Storage. The file must be a JSON serialized
98 * `DynamicTemplateFileSpec` object.
99 * @opt_param string dynamicTemplate.stagingLocation Cloud Storage path for
100 * staging dependencies. Must be a valid Cloud Storage URL, beginning with
101 * `gs://`.
102 * @opt_param string gcsPath A Cloud Storage path to the template to use to
103 * create the job. Must be valid Cloud Storage URL, beginning with `gs://`.
104 * @opt_param string location The [regional endpoint]
105 * (https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which
106 * to direct the request.
107 * @opt_param bool validateOnly If true, the request is validated but not
108 * actually executed. Defaults to false.
109 * @return LaunchTemplateResponse
110 * @throws \Google\Service\Exception
111 */
112 public function launch($projectId, LaunchTemplateParameters $postBody, $optParams = [])
113 {
114 $params = ['projectId' => $projectId, 'postBody' => $postBody];
115 $params = array_merge($params, $optParams);
116 return $this->call('launch', [$params], LaunchTemplateResponse::class);
117 }
118}
119
120// Adding a class alias for backwards compatibility with the previous class name.
121class_alias(ProjectsTemplates::class, 'Google_Service_Dataflow_Resource_ProjectsTemplates');
Note: See TracBrowser for help on using the repository browser.