[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\Dataproc\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Dataproc\DataprocEmpty;
|
---|
| 21 | use Google\Service\Dataproc\GetIamPolicyRequest;
|
---|
| 22 | use Google\Service\Dataproc\InstantiateWorkflowTemplateRequest;
|
---|
| 23 | use Google\Service\Dataproc\ListWorkflowTemplatesResponse;
|
---|
| 24 | use Google\Service\Dataproc\Operation;
|
---|
| 25 | use Google\Service\Dataproc\Policy;
|
---|
| 26 | use Google\Service\Dataproc\SetIamPolicyRequest;
|
---|
| 27 | use Google\Service\Dataproc\TestIamPermissionsRequest;
|
---|
| 28 | use Google\Service\Dataproc\TestIamPermissionsResponse;
|
---|
| 29 | use Google\Service\Dataproc\WorkflowTemplate;
|
---|
| 30 |
|
---|
| 31 | /**
|
---|
| 32 | * The "workflowTemplates" collection of methods.
|
---|
| 33 | * Typical usage is:
|
---|
| 34 | * <code>
|
---|
| 35 | * $dataprocService = new Google\Service\Dataproc(...);
|
---|
| 36 | * $workflowTemplates = $dataprocService->projects_locations_workflowTemplates;
|
---|
| 37 | * </code>
|
---|
| 38 | */
|
---|
| 39 | class ProjectsLocationsWorkflowTemplates extends \Google\Service\Resource
|
---|
| 40 | {
|
---|
| 41 | /**
|
---|
| 42 | * Creates new workflow template. (workflowTemplates.create)
|
---|
| 43 | *
|
---|
| 44 | * @param string $parent Required. The resource name of the region or location,
|
---|
| 45 | * as described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 46 | * projects.regions.workflowTemplates.create, the resource name of the region
|
---|
| 47 | * has the following format: projects/{project_id}/regions/{region} For
|
---|
| 48 | * projects.locations.workflowTemplates.create, the resource name of the
|
---|
| 49 | * location has the following format: projects/{project_id}/locations/{location}
|
---|
| 50 | * @param WorkflowTemplate $postBody
|
---|
| 51 | * @param array $optParams Optional parameters.
|
---|
| 52 | * @return WorkflowTemplate
|
---|
| 53 | * @throws \Google\Service\Exception
|
---|
| 54 | */
|
---|
| 55 | public function create($parent, WorkflowTemplate $postBody, $optParams = [])
|
---|
| 56 | {
|
---|
| 57 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 58 | $params = array_merge($params, $optParams);
|
---|
| 59 | return $this->call('create', [$params], WorkflowTemplate::class);
|
---|
| 60 | }
|
---|
| 61 | /**
|
---|
| 62 | * Deletes a workflow template. It does not cancel in-progress workflows.
|
---|
| 63 | * (workflowTemplates.delete)
|
---|
| 64 | *
|
---|
| 65 | * @param string $name Required. The resource name of the workflow template, as
|
---|
| 66 | * described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 67 | * projects.regions.workflowTemplates.delete, the resource name of the template
|
---|
| 68 | * has the following format:
|
---|
| 69 | * projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For
|
---|
| 70 | * projects.locations.workflowTemplates.instantiate, the resource name of the
|
---|
| 71 | * template has the following format:
|
---|
| 72 | * projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
|
---|
| 73 | * @param array $optParams Optional parameters.
|
---|
| 74 | *
|
---|
| 75 | * @opt_param int version Optional. The version of workflow template to delete.
|
---|
| 76 | * If specified, will only delete the template if the current server version
|
---|
| 77 | * matches specified version.
|
---|
| 78 | * @return DataprocEmpty
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function delete($name, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['name' => $name];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('delete', [$params], DataprocEmpty::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Retrieves the latest workflow template.Can retrieve previously instantiated
|
---|
| 89 | * template by specifying optional version parameter. (workflowTemplates.get)
|
---|
| 90 | *
|
---|
| 91 | * @param string $name Required. The resource name of the workflow template, as
|
---|
| 92 | * described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 93 | * projects.regions.workflowTemplates.get, the resource name of the template has
|
---|
| 94 | * the following format:
|
---|
| 95 | * projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For
|
---|
| 96 | * projects.locations.workflowTemplates.get, the resource name of the template
|
---|
| 97 | * has the following format:
|
---|
| 98 | * projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
|
---|
| 99 | * @param array $optParams Optional parameters.
|
---|
| 100 | *
|
---|
| 101 | * @opt_param int version Optional. The version of workflow template to
|
---|
| 102 | * retrieve. Only previously instantiated versions can be retrieved.If
|
---|
| 103 | * unspecified, retrieves the current version.
|
---|
| 104 | * @return WorkflowTemplate
|
---|
| 105 | * @throws \Google\Service\Exception
|
---|
| 106 | */
|
---|
| 107 | public function get($name, $optParams = [])
|
---|
| 108 | {
|
---|
| 109 | $params = ['name' => $name];
|
---|
| 110 | $params = array_merge($params, $optParams);
|
---|
| 111 | return $this->call('get', [$params], WorkflowTemplate::class);
|
---|
| 112 | }
|
---|
| 113 | /**
|
---|
| 114 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 115 | * resource exists and does not have a policy set.
|
---|
| 116 | * (workflowTemplates.getIamPolicy)
|
---|
| 117 | *
|
---|
| 118 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 119 | * requested. See Resource names
|
---|
| 120 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
| 121 | * value for this field.
|
---|
| 122 | * @param GetIamPolicyRequest $postBody
|
---|
| 123 | * @param array $optParams Optional parameters.
|
---|
| 124 | * @return Policy
|
---|
| 125 | * @throws \Google\Service\Exception
|
---|
| 126 | */
|
---|
| 127 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 128 | {
|
---|
| 129 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 130 | $params = array_merge($params, $optParams);
|
---|
| 131 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 132 | }
|
---|
| 133 | /**
|
---|
| 134 | * Instantiates a template and begins execution.The returned Operation can be
|
---|
| 135 | * used to track execution of workflow by polling operations.get. The Operation
|
---|
| 136 | * will complete when entire workflow is finished.The running workflow can be
|
---|
| 137 | * aborted via operations.cancel. This will cause any inflight jobs to be
|
---|
| 138 | * cancelled and workflow-owned clusters to be deleted.The Operation.metadata
|
---|
| 139 | * will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rp
|
---|
| 140 | * c/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata
|
---|
| 141 | * (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_wo
|
---|
| 142 | * rkflowmetadata).On successful completion, Operation.response will be Empty.
|
---|
| 143 | * (workflowTemplates.instantiate)
|
---|
| 144 | *
|
---|
| 145 | * @param string $name Required. The resource name of the workflow template, as
|
---|
| 146 | * described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 147 | * projects.regions.workflowTemplates.instantiate, the resource name of the
|
---|
| 148 | * template has the following format:
|
---|
| 149 | * projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For
|
---|
| 150 | * projects.locations.workflowTemplates.instantiate, the resource name of the
|
---|
| 151 | * template has the following format:
|
---|
| 152 | * projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
|
---|
| 153 | * @param InstantiateWorkflowTemplateRequest $postBody
|
---|
| 154 | * @param array $optParams Optional parameters.
|
---|
| 155 | * @return Operation
|
---|
| 156 | * @throws \Google\Service\Exception
|
---|
| 157 | */
|
---|
| 158 | public function instantiate($name, InstantiateWorkflowTemplateRequest $postBody, $optParams = [])
|
---|
| 159 | {
|
---|
| 160 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 161 | $params = array_merge($params, $optParams);
|
---|
| 162 | return $this->call('instantiate', [$params], Operation::class);
|
---|
| 163 | }
|
---|
| 164 | /**
|
---|
| 165 | * Instantiates a template and begins execution.This method is equivalent to
|
---|
| 166 | * executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate,
|
---|
| 167 | * DeleteWorkflowTemplate.The returned Operation can be used to track execution
|
---|
| 168 | * of workflow by polling operations.get. The Operation will complete when
|
---|
| 169 | * entire workflow is finished.The running workflow can be aborted via
|
---|
| 170 | * operations.cancel. This will cause any inflight jobs to be cancelled and
|
---|
| 171 | * workflow-owned clusters to be deleted.The Operation.metadata will be
|
---|
| 172 | * WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google
|
---|
| 173 | * .cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https:
|
---|
| 174 | * //cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowm
|
---|
| 175 | * etadata).On successful completion, Operation.response will be Empty.
|
---|
| 176 | * (workflowTemplates.instantiateInline)
|
---|
| 177 | *
|
---|
| 178 | * @param string $parent Required. The resource name of the region or location,
|
---|
| 179 | * as described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 180 | * projects.regions.workflowTemplates,instantiateinline, the resource name of
|
---|
| 181 | * the region has the following format: projects/{project_id}/regions/{region}
|
---|
| 182 | * For projects.locations.workflowTemplates.instantiateinline, the resource name
|
---|
| 183 | * of the location has the following format:
|
---|
| 184 | * projects/{project_id}/locations/{location}
|
---|
| 185 | * @param WorkflowTemplate $postBody
|
---|
| 186 | * @param array $optParams Optional parameters.
|
---|
| 187 | *
|
---|
| 188 | * @opt_param string requestId Optional. A tag that prevents multiple concurrent
|
---|
| 189 | * workflow instances with the same tag from running. This mitigates risk of
|
---|
| 190 | * concurrent instances started due to retries.It is recommended to always set
|
---|
| 191 | * this value to a UUID
|
---|
| 192 | * (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must
|
---|
| 193 | * contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens
|
---|
| 194 | * (-). The maximum length is 40 characters.
|
---|
| 195 | * @return Operation
|
---|
| 196 | * @throws \Google\Service\Exception
|
---|
| 197 | */
|
---|
| 198 | public function instantiateInline($parent, WorkflowTemplate $postBody, $optParams = [])
|
---|
| 199 | {
|
---|
| 200 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 201 | $params = array_merge($params, $optParams);
|
---|
| 202 | return $this->call('instantiateInline', [$params], Operation::class);
|
---|
| 203 | }
|
---|
| 204 | /**
|
---|
| 205 | * Lists workflows that match the specified filter in the request.
|
---|
| 206 | * (workflowTemplates.listProjectsLocationsWorkflowTemplates)
|
---|
| 207 | *
|
---|
| 208 | * @param string $parent Required. The resource name of the region or location,
|
---|
| 209 | * as described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 210 | * projects.regions.workflowTemplates,list, the resource name of the region has
|
---|
| 211 | * the following format: projects/{project_id}/regions/{region} For
|
---|
| 212 | * projects.locations.workflowTemplates.list, the resource name of the location
|
---|
| 213 | * has the following format: projects/{project_id}/locations/{location}
|
---|
| 214 | * @param array $optParams Optional parameters.
|
---|
| 215 | *
|
---|
| 216 | * @opt_param int pageSize Optional. The maximum number of results to return in
|
---|
| 217 | * each response.
|
---|
| 218 | * @opt_param string pageToken Optional. The page token, returned by a previous
|
---|
| 219 | * call, to request the next page of results.
|
---|
| 220 | * @return ListWorkflowTemplatesResponse
|
---|
| 221 | * @throws \Google\Service\Exception
|
---|
| 222 | */
|
---|
| 223 | public function listProjectsLocationsWorkflowTemplates($parent, $optParams = [])
|
---|
| 224 | {
|
---|
| 225 | $params = ['parent' => $parent];
|
---|
| 226 | $params = array_merge($params, $optParams);
|
---|
| 227 | return $this->call('list', [$params], ListWorkflowTemplatesResponse::class);
|
---|
| 228 | }
|
---|
| 229 | /**
|
---|
| 230 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 231 | * existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
|
---|
| 232 | * errors. (workflowTemplates.setIamPolicy)
|
---|
| 233 | *
|
---|
| 234 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 235 | * specified. See Resource names
|
---|
| 236 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
| 237 | * value for this field.
|
---|
| 238 | * @param SetIamPolicyRequest $postBody
|
---|
| 239 | * @param array $optParams Optional parameters.
|
---|
| 240 | * @return Policy
|
---|
| 241 | * @throws \Google\Service\Exception
|
---|
| 242 | */
|
---|
| 243 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 244 | {
|
---|
| 245 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 246 | $params = array_merge($params, $optParams);
|
---|
| 247 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 248 | }
|
---|
| 249 | /**
|
---|
| 250 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 251 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 252 | * NOT_FOUND error.Note: This operation is designed to be used for building
|
---|
| 253 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 254 | * This operation may "fail open" without warning.
|
---|
| 255 | * (workflowTemplates.testIamPermissions)
|
---|
| 256 | *
|
---|
| 257 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 258 | * being requested. See Resource names
|
---|
| 259 | * (https://cloud.google.com/apis/design/resource_names) for the appropriate
|
---|
| 260 | * value for this field.
|
---|
| 261 | * @param TestIamPermissionsRequest $postBody
|
---|
| 262 | * @param array $optParams Optional parameters.
|
---|
| 263 | * @return TestIamPermissionsResponse
|
---|
| 264 | * @throws \Google\Service\Exception
|
---|
| 265 | */
|
---|
| 266 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 267 | {
|
---|
| 268 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 269 | $params = array_merge($params, $optParams);
|
---|
| 270 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 271 | }
|
---|
| 272 | /**
|
---|
| 273 | * Updates (replaces) workflow template. The updated template must contain
|
---|
| 274 | * version that matches the current server version. (workflowTemplates.update)
|
---|
| 275 | *
|
---|
| 276 | * @param string $name Output only. The resource name of the workflow template,
|
---|
| 277 | * as described in https://cloud.google.com/apis/design/resource_names. For
|
---|
| 278 | * projects.regions.workflowTemplates, the resource name of the template has the
|
---|
| 279 | * following format:
|
---|
| 280 | * projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For
|
---|
| 281 | * projects.locations.workflowTemplates, the resource name of the template has
|
---|
| 282 | * the following format:
|
---|
| 283 | * projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
|
---|
| 284 | * @param WorkflowTemplate $postBody
|
---|
| 285 | * @param array $optParams Optional parameters.
|
---|
| 286 | * @return WorkflowTemplate
|
---|
| 287 | * @throws \Google\Service\Exception
|
---|
| 288 | */
|
---|
| 289 | public function update($name, WorkflowTemplate $postBody, $optParams = [])
|
---|
| 290 | {
|
---|
| 291 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 292 | $params = array_merge($params, $optParams);
|
---|
| 293 | return $this->call('update', [$params], WorkflowTemplate::class);
|
---|
| 294 | }
|
---|
| 295 | }
|
---|
| 296 |
|
---|
| 297 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 298 | class_alias(ProjectsLocationsWorkflowTemplates::class, 'Google_Service_Dataproc_Resource_ProjectsLocationsWorkflowTemplates');
|
---|