[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\Config\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Config\ConfigEmpty;
|
---|
| 21 | use Google\Service\Config\DeleteStatefileRequest;
|
---|
| 22 | use Google\Service\Config\Deployment;
|
---|
| 23 | use Google\Service\Config\ExportDeploymentStatefileRequest;
|
---|
| 24 | use Google\Service\Config\ImportStatefileRequest;
|
---|
| 25 | use Google\Service\Config\ListDeploymentsResponse;
|
---|
| 26 | use Google\Service\Config\LockDeploymentRequest;
|
---|
| 27 | use Google\Service\Config\LockInfo;
|
---|
| 28 | use Google\Service\Config\Operation;
|
---|
| 29 | use Google\Service\Config\Policy;
|
---|
| 30 | use Google\Service\Config\SetIamPolicyRequest;
|
---|
| 31 | use Google\Service\Config\Statefile;
|
---|
| 32 | use Google\Service\Config\TestIamPermissionsRequest;
|
---|
| 33 | use Google\Service\Config\TestIamPermissionsResponse;
|
---|
| 34 | use Google\Service\Config\UnlockDeploymentRequest;
|
---|
| 35 |
|
---|
| 36 | /**
|
---|
| 37 | * The "deployments" collection of methods.
|
---|
| 38 | * Typical usage is:
|
---|
| 39 | * <code>
|
---|
| 40 | * $configService = new Google\Service\Config(...);
|
---|
| 41 | * $deployments = $configService->projects_locations_deployments;
|
---|
| 42 | * </code>
|
---|
| 43 | */
|
---|
| 44 | class ProjectsLocationsDeployments extends \Google\Service\Resource
|
---|
| 45 | {
|
---|
| 46 | /**
|
---|
| 47 | * Creates a Deployment. (deployments.create)
|
---|
| 48 | *
|
---|
| 49 | * @param string $parent Required. The parent in whose context the Deployment is
|
---|
| 50 | * created. The parent value is in the format:
|
---|
| 51 | * 'projects/{project_id}/locations/{location}'.
|
---|
| 52 | * @param Deployment $postBody
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | *
|
---|
| 55 | * @opt_param string deploymentId Required. The Deployment ID.
|
---|
| 56 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 57 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 58 | * the server will know to ignore the request if it has already been completed.
|
---|
| 59 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 60 | * request. For example, consider a situation where you make an initial request
|
---|
| 61 | * and the request times out. If you make the request again with the same
|
---|
| 62 | * request ID, the server can check if original operation with the same request
|
---|
| 63 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 64 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 65 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 66 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 67 | * @return Operation
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function create($parent, Deployment $postBody, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('create', [$params], Operation::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Deletes a Deployment. (deployments.delete)
|
---|
| 78 | *
|
---|
| 79 | * @param string $name Required. The name of the Deployment in the format:
|
---|
| 80 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 81 | * @param array $optParams Optional parameters.
|
---|
| 82 | *
|
---|
| 83 | * @opt_param string deletePolicy Optional. Policy on how resources actuated by
|
---|
| 84 | * the deployment should be deleted. If unspecified, the default behavior is to
|
---|
| 85 | * delete the underlying resources.
|
---|
| 86 | * @opt_param bool force Optional. If set to true, any revisions for this
|
---|
| 87 | * deployment will also be deleted. (Otherwise, the request will only work if
|
---|
| 88 | * the deployment has no revisions.)
|
---|
| 89 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 90 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 91 | * the server will know to ignore the request if it has already been completed.
|
---|
| 92 | * The server will guarantee that for at least 60 minutes after the first
|
---|
| 93 | * request. For example, consider a situation where you make an initial request
|
---|
| 94 | * and the request times out. If you make the request again with the same
|
---|
| 95 | * request ID, the server can check if original operation with the same request
|
---|
| 96 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 97 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 98 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 99 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 100 | * @return Operation
|
---|
| 101 | * @throws \Google\Service\Exception
|
---|
| 102 | */
|
---|
| 103 | public function delete($name, $optParams = [])
|
---|
| 104 | {
|
---|
| 105 | $params = ['name' => $name];
|
---|
| 106 | $params = array_merge($params, $optParams);
|
---|
| 107 | return $this->call('delete', [$params], Operation::class);
|
---|
| 108 | }
|
---|
| 109 | /**
|
---|
| 110 | * Deletes Terraform state file in a given deployment. (deployments.deleteState)
|
---|
| 111 | *
|
---|
| 112 | * @param string $name Required. The name of the deployment in the format:
|
---|
| 113 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 114 | * @param DeleteStatefileRequest $postBody
|
---|
| 115 | * @param array $optParams Optional parameters.
|
---|
| 116 | * @return ConfigEmpty
|
---|
| 117 | * @throws \Google\Service\Exception
|
---|
| 118 | */
|
---|
| 119 | public function deleteState($name, DeleteStatefileRequest $postBody, $optParams = [])
|
---|
| 120 | {
|
---|
| 121 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 122 | $params = array_merge($params, $optParams);
|
---|
| 123 | return $this->call('deleteState', [$params], ConfigEmpty::class);
|
---|
| 124 | }
|
---|
| 125 | /**
|
---|
| 126 | * Exports the lock info on a locked deployment. (deployments.exportLock)
|
---|
| 127 | *
|
---|
| 128 | * @param string $name Required. The name of the deployment in the format:
|
---|
| 129 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 130 | * @param array $optParams Optional parameters.
|
---|
| 131 | * @return LockInfo
|
---|
| 132 | * @throws \Google\Service\Exception
|
---|
| 133 | */
|
---|
| 134 | public function exportLock($name, $optParams = [])
|
---|
| 135 | {
|
---|
| 136 | $params = ['name' => $name];
|
---|
| 137 | $params = array_merge($params, $optParams);
|
---|
| 138 | return $this->call('exportLock', [$params], LockInfo::class);
|
---|
| 139 | }
|
---|
| 140 | /**
|
---|
| 141 | * Exports Terraform state file from a given deployment.
|
---|
| 142 | * (deployments.exportState)
|
---|
| 143 | *
|
---|
| 144 | * @param string $parent Required. The parent in whose context the statefile is
|
---|
| 145 | * listed. The parent value is in the format:
|
---|
| 146 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 147 | * @param ExportDeploymentStatefileRequest $postBody
|
---|
| 148 | * @param array $optParams Optional parameters.
|
---|
| 149 | * @return Statefile
|
---|
| 150 | * @throws \Google\Service\Exception
|
---|
| 151 | */
|
---|
| 152 | public function exportState($parent, ExportDeploymentStatefileRequest $postBody, $optParams = [])
|
---|
| 153 | {
|
---|
| 154 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 155 | $params = array_merge($params, $optParams);
|
---|
| 156 | return $this->call('exportState', [$params], Statefile::class);
|
---|
| 157 | }
|
---|
| 158 | /**
|
---|
| 159 | * Gets details about a Deployment. (deployments.get)
|
---|
| 160 | *
|
---|
| 161 | * @param string $name Required. The name of the deployment. Format:
|
---|
| 162 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 163 | * @param array $optParams Optional parameters.
|
---|
| 164 | * @return Deployment
|
---|
| 165 | * @throws \Google\Service\Exception
|
---|
| 166 | */
|
---|
| 167 | public function get($name, $optParams = [])
|
---|
| 168 | {
|
---|
| 169 | $params = ['name' => $name];
|
---|
| 170 | $params = array_merge($params, $optParams);
|
---|
| 171 | return $this->call('get', [$params], Deployment::class);
|
---|
| 172 | }
|
---|
| 173 | /**
|
---|
| 174 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 175 | * resource exists and does not have a policy set. (deployments.getIamPolicy)
|
---|
| 176 | *
|
---|
| 177 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 178 | * requested. See [Resource
|
---|
| 179 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 180 | * appropriate value for this field.
|
---|
| 181 | * @param array $optParams Optional parameters.
|
---|
| 182 | *
|
---|
| 183 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 184 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 185 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 186 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 187 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 188 | * unset. The policy in the response might use the policy version that you
|
---|
| 189 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 190 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 191 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 192 | * IAM policies, see the [IAM
|
---|
| 193 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 194 | * policies).
|
---|
| 195 | * @return Policy
|
---|
| 196 | * @throws \Google\Service\Exception
|
---|
| 197 | */
|
---|
| 198 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 199 | {
|
---|
| 200 | $params = ['resource' => $resource];
|
---|
| 201 | $params = array_merge($params, $optParams);
|
---|
| 202 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 203 | }
|
---|
| 204 | /**
|
---|
| 205 | * Imports Terraform state file in a given deployment. The state file does not
|
---|
| 206 | * take effect until the Deployment has been unlocked. (deployments.importState)
|
---|
| 207 | *
|
---|
| 208 | * @param string $parent Required. The parent in whose context the statefile is
|
---|
| 209 | * listed. The parent value is in the format:
|
---|
| 210 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 211 | * @param ImportStatefileRequest $postBody
|
---|
| 212 | * @param array $optParams Optional parameters.
|
---|
| 213 | * @return Statefile
|
---|
| 214 | * @throws \Google\Service\Exception
|
---|
| 215 | */
|
---|
| 216 | public function importState($parent, ImportStatefileRequest $postBody, $optParams = [])
|
---|
| 217 | {
|
---|
| 218 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 219 | $params = array_merge($params, $optParams);
|
---|
| 220 | return $this->call('importState', [$params], Statefile::class);
|
---|
| 221 | }
|
---|
| 222 | /**
|
---|
| 223 | * Lists Deployments in a given project and location.
|
---|
| 224 | * (deployments.listProjectsLocationsDeployments)
|
---|
| 225 | *
|
---|
| 226 | * @param string $parent Required. The parent in whose context the Deployments
|
---|
| 227 | * are listed. The parent value is in the format:
|
---|
| 228 | * 'projects/{project_id}/locations/{location}'.
|
---|
| 229 | * @param array $optParams Optional parameters.
|
---|
| 230 | *
|
---|
| 231 | * @opt_param string filter Lists the Deployments that match the filter
|
---|
| 232 | * expression. A filter expression filters the resources listed in the response.
|
---|
| 233 | * The expression must be of the form '{field} {operator} {value}' where
|
---|
| 234 | * operators: '<', '>', '<=', '>=', '!=', '=', ':' are supported (colon ':'
|
---|
| 235 | * represents a HAS operator which is roughly synonymous with equality). {field}
|
---|
| 236 | * can refer to a proto or JSON field, or a synthetic field. Field names can be
|
---|
| 237 | * camelCase or snake_case. Examples: - Filter by name: name =
|
---|
| 238 | * "projects/foo/locations/us-central1/deployments/bar - Filter by labels: -
|
---|
| 239 | * Resources that have a key called 'foo' labels.foo:* - Resources that have a
|
---|
| 240 | * key called 'foo' whose value is 'bar' labels.foo = bar - Filter by state: -
|
---|
| 241 | * Deployments in CREATING state. state=CREATING
|
---|
| 242 | * @opt_param string orderBy Field to use to sort the list.
|
---|
| 243 | * @opt_param int pageSize When requesting a page of resources, 'page_size'
|
---|
| 244 | * specifies number of resources to return. If unspecified, at most 500 will be
|
---|
| 245 | * returned. The maximum value is 1000.
|
---|
| 246 | * @opt_param string pageToken Token returned by previous call to
|
---|
| 247 | * 'ListDeployments' which specifies the position in the list from where to
|
---|
| 248 | * continue listing the resources.
|
---|
| 249 | * @return ListDeploymentsResponse
|
---|
| 250 | * @throws \Google\Service\Exception
|
---|
| 251 | */
|
---|
| 252 | public function listProjectsLocationsDeployments($parent, $optParams = [])
|
---|
| 253 | {
|
---|
| 254 | $params = ['parent' => $parent];
|
---|
| 255 | $params = array_merge($params, $optParams);
|
---|
| 256 | return $this->call('list', [$params], ListDeploymentsResponse::class);
|
---|
| 257 | }
|
---|
| 258 | /**
|
---|
| 259 | * Locks a deployment. (deployments.lock)
|
---|
| 260 | *
|
---|
| 261 | * @param string $name Required. The name of the deployment in the format:
|
---|
| 262 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 263 | * @param LockDeploymentRequest $postBody
|
---|
| 264 | * @param array $optParams Optional parameters.
|
---|
| 265 | * @return Operation
|
---|
| 266 | * @throws \Google\Service\Exception
|
---|
| 267 | */
|
---|
| 268 | public function lock($name, LockDeploymentRequest $postBody, $optParams = [])
|
---|
| 269 | {
|
---|
| 270 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 271 | $params = array_merge($params, $optParams);
|
---|
| 272 | return $this->call('lock', [$params], Operation::class);
|
---|
| 273 | }
|
---|
| 274 | /**
|
---|
| 275 | * Updates a Deployment. (deployments.patch)
|
---|
| 276 | *
|
---|
| 277 | * @param string $name Resource name of the deployment. Format:
|
---|
| 278 | * `projects/{project}/locations/{location}/deployments/{deployment}`
|
---|
| 279 | * @param Deployment $postBody
|
---|
| 280 | * @param array $optParams Optional parameters.
|
---|
| 281 | *
|
---|
| 282 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 283 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 284 | * the server will know to ignore the request if it has already been completed.
|
---|
| 285 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 286 | * request. For example, consider a situation where you make an initial request
|
---|
| 287 | * and the request times out. If you make the request again with the same
|
---|
| 288 | * request ID, the server can check if original operation with the same request
|
---|
| 289 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 290 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 291 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 292 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 293 | * @opt_param string updateMask Optional. Field mask used to specify the fields
|
---|
| 294 | * to be overwritten in the Deployment resource by the update. The fields
|
---|
| 295 | * specified in the update_mask are relative to the resource, not the full
|
---|
| 296 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
| 297 | * not provide a mask then all fields will be overwritten.
|
---|
| 298 | * @return Operation
|
---|
| 299 | * @throws \Google\Service\Exception
|
---|
| 300 | */
|
---|
| 301 | public function patch($name, Deployment $postBody, $optParams = [])
|
---|
| 302 | {
|
---|
| 303 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 304 | $params = array_merge($params, $optParams);
|
---|
| 305 | return $this->call('patch', [$params], Operation::class);
|
---|
| 306 | }
|
---|
| 307 | /**
|
---|
| 308 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 309 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 310 | * `PERMISSION_DENIED` errors. (deployments.setIamPolicy)
|
---|
| 311 | *
|
---|
| 312 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 313 | * specified. See [Resource
|
---|
| 314 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 315 | * appropriate value for this field.
|
---|
| 316 | * @param SetIamPolicyRequest $postBody
|
---|
| 317 | * @param array $optParams Optional parameters.
|
---|
| 318 | * @return Policy
|
---|
| 319 | * @throws \Google\Service\Exception
|
---|
| 320 | */
|
---|
| 321 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 322 | {
|
---|
| 323 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 324 | $params = array_merge($params, $optParams);
|
---|
| 325 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 326 | }
|
---|
| 327 | /**
|
---|
| 328 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 329 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 330 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 331 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 332 | * This operation may "fail open" without warning.
|
---|
| 333 | * (deployments.testIamPermissions)
|
---|
| 334 | *
|
---|
| 335 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 336 | * being requested. See [Resource
|
---|
| 337 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 338 | * appropriate value for this field.
|
---|
| 339 | * @param TestIamPermissionsRequest $postBody
|
---|
| 340 | * @param array $optParams Optional parameters.
|
---|
| 341 | * @return TestIamPermissionsResponse
|
---|
| 342 | * @throws \Google\Service\Exception
|
---|
| 343 | */
|
---|
| 344 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 345 | {
|
---|
| 346 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 347 | $params = array_merge($params, $optParams);
|
---|
| 348 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 349 | }
|
---|
| 350 | /**
|
---|
| 351 | * Unlocks a locked deployment. (deployments.unlock)
|
---|
| 352 | *
|
---|
| 353 | * @param string $name Required. The name of the deployment in the format:
|
---|
| 354 | * 'projects/{project_id}/locations/{location}/deployments/{deployment}'.
|
---|
| 355 | * @param UnlockDeploymentRequest $postBody
|
---|
| 356 | * @param array $optParams Optional parameters.
|
---|
| 357 | * @return Operation
|
---|
| 358 | * @throws \Google\Service\Exception
|
---|
| 359 | */
|
---|
| 360 | public function unlock($name, UnlockDeploymentRequest $postBody, $optParams = [])
|
---|
| 361 | {
|
---|
| 362 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 363 | $params = array_merge($params, $optParams);
|
---|
| 364 | return $this->call('unlock', [$params], Operation::class);
|
---|
| 365 | }
|
---|
| 366 | }
|
---|
| 367 |
|
---|
| 368 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 369 | class_alias(ProjectsLocationsDeployments::class, 'Google_Service_Config_Resource_ProjectsLocationsDeployments');
|
---|