[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\DeploymentManager\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\DeploymentManager\Deployment;
|
---|
| 21 | use Google\Service\DeploymentManager\DeploymentsCancelPreviewRequest;
|
---|
| 22 | use Google\Service\DeploymentManager\DeploymentsListResponse;
|
---|
| 23 | use Google\Service\DeploymentManager\DeploymentsStopRequest;
|
---|
| 24 | use Google\Service\DeploymentManager\GlobalSetPolicyRequest;
|
---|
| 25 | use Google\Service\DeploymentManager\Operation;
|
---|
| 26 | use Google\Service\DeploymentManager\Policy;
|
---|
| 27 | use Google\Service\DeploymentManager\TestPermissionsRequest;
|
---|
| 28 | use Google\Service\DeploymentManager\TestPermissionsResponse;
|
---|
| 29 |
|
---|
| 30 | /**
|
---|
| 31 | * The "deployments" collection of methods.
|
---|
| 32 | * Typical usage is:
|
---|
| 33 | * <code>
|
---|
| 34 | * $deploymentmanagerService = new Google\Service\DeploymentManager(...);
|
---|
| 35 | * $deployments = $deploymentmanagerService->deployments;
|
---|
| 36 | * </code>
|
---|
| 37 | */
|
---|
| 38 | class Deployments extends \Google\Service\Resource
|
---|
| 39 | {
|
---|
| 40 | /**
|
---|
| 41 | * Cancels and removes the preview currently associated with the deployment.
|
---|
| 42 | * (deployments.cancelPreview)
|
---|
| 43 | *
|
---|
| 44 | * @param string $project The project ID for this request.
|
---|
| 45 | * @param string $deployment The name of the deployment for this request.
|
---|
| 46 | * @param DeploymentsCancelPreviewRequest $postBody
|
---|
| 47 | * @param array $optParams Optional parameters.
|
---|
| 48 | * @return Operation
|
---|
| 49 | * @throws \Google\Service\Exception
|
---|
| 50 | */
|
---|
| 51 | public function cancelPreview($project, $deployment, DeploymentsCancelPreviewRequest $postBody, $optParams = [])
|
---|
| 52 | {
|
---|
| 53 | $params = ['project' => $project, 'deployment' => $deployment, 'postBody' => $postBody];
|
---|
| 54 | $params = array_merge($params, $optParams);
|
---|
| 55 | return $this->call('cancelPreview', [$params], Operation::class);
|
---|
| 56 | }
|
---|
| 57 | /**
|
---|
| 58 | * Deletes a deployment and all of the resources in the deployment.
|
---|
| 59 | * (deployments.delete)
|
---|
| 60 | *
|
---|
| 61 | * @param string $project The project ID for this request.
|
---|
| 62 | * @param string $deployment The name of the deployment for this request.
|
---|
| 63 | * @param array $optParams Optional parameters.
|
---|
| 64 | *
|
---|
| 65 | * @opt_param string deletePolicy Sets the policy to use for deleting resources.
|
---|
| 66 | * @opt_param bool header.bypassBillingFilter
|
---|
| 67 | * @return Operation
|
---|
| 68 | * @throws \Google\Service\Exception
|
---|
| 69 | */
|
---|
| 70 | public function delete($project, $deployment, $optParams = [])
|
---|
| 71 | {
|
---|
| 72 | $params = ['project' => $project, 'deployment' => $deployment];
|
---|
| 73 | $params = array_merge($params, $optParams);
|
---|
| 74 | return $this->call('delete', [$params], Operation::class);
|
---|
| 75 | }
|
---|
| 76 | /**
|
---|
| 77 | * Gets information about a specific deployment. (deployments.get)
|
---|
| 78 | *
|
---|
| 79 | * @param string $project The project ID for this request.
|
---|
| 80 | * @param string $deployment The name of the deployment for this request.
|
---|
| 81 | * @param array $optParams Optional parameters.
|
---|
| 82 | *
|
---|
| 83 | * @opt_param bool header.bypassBillingFilter
|
---|
| 84 | * @return Deployment
|
---|
| 85 | * @throws \Google\Service\Exception
|
---|
| 86 | */
|
---|
| 87 | public function get($project, $deployment, $optParams = [])
|
---|
| 88 | {
|
---|
| 89 | $params = ['project' => $project, 'deployment' => $deployment];
|
---|
| 90 | $params = array_merge($params, $optParams);
|
---|
| 91 | return $this->call('get', [$params], Deployment::class);
|
---|
| 92 | }
|
---|
| 93 | /**
|
---|
| 94 | * Gets the access control policy for a resource. May be empty if no such policy
|
---|
| 95 | * or resource exists. (deployments.getIamPolicy)
|
---|
| 96 | *
|
---|
| 97 | * @param string $project Project ID for this request.
|
---|
| 98 | * @param string $resource Name or id of the resource for this request.
|
---|
| 99 | * @param array $optParams Optional parameters.
|
---|
| 100 | *
|
---|
| 101 | * @opt_param bool header.bypassBillingFilter
|
---|
| 102 | * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
|
---|
| 103 | * @return Policy
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function getIamPolicy($project, $resource, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['project' => $project, 'resource' => $resource];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Creates a deployment and all of the resources described by the deployment
|
---|
| 114 | * manifest. (deployments.insert)
|
---|
| 115 | *
|
---|
| 116 | * @param string $project The project ID for this request.
|
---|
| 117 | * @param Deployment $postBody
|
---|
| 118 | * @param array $optParams Optional parameters.
|
---|
| 119 | *
|
---|
| 120 | * @opt_param string createPolicy Sets the policy to use for creating new
|
---|
| 121 | * resources.
|
---|
| 122 | * @opt_param bool header.bypassBillingFilter
|
---|
| 123 | * @opt_param bool preview If set to true, creates a deployment and creates
|
---|
| 124 | * "shell" resources but does not actually instantiate these resources. This
|
---|
| 125 | * allows you to preview what your deployment looks like. After previewing a
|
---|
| 126 | * deployment, you can deploy your resources by making a request with the
|
---|
| 127 | * `update()` method or you can use the `cancelPreview()` method to cancel the
|
---|
| 128 | * preview altogether. Note that the deployment will still exist after you
|
---|
| 129 | * cancel the preview and you must separately delete this deployment if you want
|
---|
| 130 | * to remove it.
|
---|
| 131 | * @return Operation
|
---|
| 132 | * @throws \Google\Service\Exception
|
---|
| 133 | */
|
---|
| 134 | public function insert($project, Deployment $postBody, $optParams = [])
|
---|
| 135 | {
|
---|
| 136 | $params = ['project' => $project, 'postBody' => $postBody];
|
---|
| 137 | $params = array_merge($params, $optParams);
|
---|
| 138 | return $this->call('insert', [$params], Operation::class);
|
---|
| 139 | }
|
---|
| 140 | /**
|
---|
| 141 | * Lists all deployments for a given project. (deployments.listDeployments)
|
---|
| 142 | *
|
---|
| 143 | * @param string $project The project ID for this request.
|
---|
| 144 | * @param array $optParams Optional parameters.
|
---|
| 145 | *
|
---|
| 146 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 147 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 148 | * expressions that support regular expressions and expressions that follow API
|
---|
| 149 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 150 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 151 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 152 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 153 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 154 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 155 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 156 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 157 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 158 | * also filter nested fields. For example, you could specify
|
---|
| 159 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 160 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 161 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 162 | * provide each separate expression within parentheses. For example: ```
|
---|
| 163 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 164 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 165 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 166 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 167 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 168 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 169 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 170 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 171 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 172 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 173 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 174 | * literal value must match the entire field. For example, to filter for
|
---|
| 175 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 176 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 177 | * expressions.
|
---|
| 178 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 179 | * should be returned. If the number of available results is larger than
|
---|
| 180 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 181 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 182 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 183 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 184 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 185 | * can also sort results in descending order based on the creation timestamp
|
---|
| 186 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 187 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 188 | * first). Use this to sort resources like operations so that the newest
|
---|
| 189 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 190 | * `creationTimestamp desc` is supported.
|
---|
| 191 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 192 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 193 | * of results.
|
---|
| 194 | * @return DeploymentsListResponse
|
---|
| 195 | * @throws \Google\Service\Exception
|
---|
| 196 | */
|
---|
| 197 | public function listDeployments($project, $optParams = [])
|
---|
| 198 | {
|
---|
| 199 | $params = ['project' => $project];
|
---|
| 200 | $params = array_merge($params, $optParams);
|
---|
| 201 | return $this->call('list', [$params], DeploymentsListResponse::class);
|
---|
| 202 | }
|
---|
| 203 | /**
|
---|
| 204 | * Patches a deployment and all of the resources described by the deployment
|
---|
| 205 | * manifest. (deployments.patch)
|
---|
| 206 | *
|
---|
| 207 | * @param string $project The project ID for this request.
|
---|
| 208 | * @param string $deployment The name of the deployment for this request.
|
---|
| 209 | * @param Deployment $postBody
|
---|
| 210 | * @param array $optParams Optional parameters.
|
---|
| 211 | *
|
---|
| 212 | * @opt_param string createPolicy Sets the policy to use for creating new
|
---|
| 213 | * resources.
|
---|
| 214 | * @opt_param string deletePolicy Sets the policy to use for deleting resources.
|
---|
| 215 | * @opt_param bool header.bypassBillingFilter
|
---|
| 216 | * @opt_param bool preview If set to true, updates the deployment and creates
|
---|
| 217 | * and updates the "shell" resources but does not actually alter or instantiate
|
---|
| 218 | * these resources. This allows you to preview what your deployment will look
|
---|
| 219 | * like. You can use this intent to preview how an update would affect your
|
---|
| 220 | * deployment. You must provide a `target.config` with a configuration if this
|
---|
| 221 | * is set to true. After previewing a deployment, you can deploy your resources
|
---|
| 222 | * by making a request with the `update()` or you can `cancelPreview()` to
|
---|
| 223 | * remove the preview altogether. Note that the deployment will still exist
|
---|
| 224 | * after you cancel the preview and you must separately delete this deployment
|
---|
| 225 | * if you want to remove it.
|
---|
| 226 | * @return Operation
|
---|
| 227 | * @throws \Google\Service\Exception
|
---|
| 228 | */
|
---|
| 229 | public function patch($project, $deployment, Deployment $postBody, $optParams = [])
|
---|
| 230 | {
|
---|
| 231 | $params = ['project' => $project, 'deployment' => $deployment, 'postBody' => $postBody];
|
---|
| 232 | $params = array_merge($params, $optParams);
|
---|
| 233 | return $this->call('patch', [$params], Operation::class);
|
---|
| 234 | }
|
---|
| 235 | /**
|
---|
| 236 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 237 | * existing policy. (deployments.setIamPolicy)
|
---|
| 238 | *
|
---|
| 239 | * @param string $project Project ID for this request.
|
---|
| 240 | * @param string $resource Name or id of the resource for this request.
|
---|
| 241 | * @param GlobalSetPolicyRequest $postBody
|
---|
| 242 | * @param array $optParams Optional parameters.
|
---|
| 243 | * @return Policy
|
---|
| 244 | * @throws \Google\Service\Exception
|
---|
| 245 | */
|
---|
| 246 | public function setIamPolicy($project, $resource, GlobalSetPolicyRequest $postBody, $optParams = [])
|
---|
| 247 | {
|
---|
| 248 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 249 | $params = array_merge($params, $optParams);
|
---|
| 250 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 251 | }
|
---|
| 252 | /**
|
---|
| 253 | * Stops an ongoing operation. This does not roll back any work that has already
|
---|
| 254 | * been completed, but prevents any new work from being started.
|
---|
| 255 | * (deployments.stop)
|
---|
| 256 | *
|
---|
| 257 | * @param string $project The project ID for this request.
|
---|
| 258 | * @param string $deployment The name of the deployment for this request.
|
---|
| 259 | * @param DeploymentsStopRequest $postBody
|
---|
| 260 | * @param array $optParams Optional parameters.
|
---|
| 261 | * @return Operation
|
---|
| 262 | * @throws \Google\Service\Exception
|
---|
| 263 | */
|
---|
| 264 | public function stop($project, $deployment, DeploymentsStopRequest $postBody, $optParams = [])
|
---|
| 265 | {
|
---|
| 266 | $params = ['project' => $project, 'deployment' => $deployment, 'postBody' => $postBody];
|
---|
| 267 | $params = array_merge($params, $optParams);
|
---|
| 268 | return $this->call('stop', [$params], Operation::class);
|
---|
| 269 | }
|
---|
| 270 | /**
|
---|
| 271 | * Returns permissions that a caller has on the specified resource.
|
---|
| 272 | * (deployments.testIamPermissions)
|
---|
| 273 | *
|
---|
| 274 | * @param string $project Project ID for this request.
|
---|
| 275 | * @param string $resource Name or id of the resource for this request.
|
---|
| 276 | * @param TestPermissionsRequest $postBody
|
---|
| 277 | * @param array $optParams Optional parameters.
|
---|
| 278 | *
|
---|
| 279 | * @opt_param bool header.bypassBillingFilter
|
---|
| 280 | * @return TestPermissionsResponse
|
---|
| 281 | * @throws \Google\Service\Exception
|
---|
| 282 | */
|
---|
| 283 | public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
| 284 | {
|
---|
| 285 | $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 286 | $params = array_merge($params, $optParams);
|
---|
| 287 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
| 288 | }
|
---|
| 289 | /**
|
---|
| 290 | * Updates a deployment and all of the resources described by the deployment
|
---|
| 291 | * manifest. (deployments.update)
|
---|
| 292 | *
|
---|
| 293 | * @param string $project The project ID for this request.
|
---|
| 294 | * @param string $deployment The name of the deployment for this request.
|
---|
| 295 | * @param Deployment $postBody
|
---|
| 296 | * @param array $optParams Optional parameters.
|
---|
| 297 | *
|
---|
| 298 | * @opt_param string createPolicy Sets the policy to use for creating new
|
---|
| 299 | * resources.
|
---|
| 300 | * @opt_param string deletePolicy Sets the policy to use for deleting resources.
|
---|
| 301 | * @opt_param bool header.bypassBillingFilter
|
---|
| 302 | * @opt_param bool preview If set to true, updates the deployment and creates
|
---|
| 303 | * and updates the "shell" resources but does not actually alter or instantiate
|
---|
| 304 | * these resources. This allows you to preview what your deployment will look
|
---|
| 305 | * like. You can use this intent to preview how an update would affect your
|
---|
| 306 | * deployment. You must provide a `target.config` with a configuration if this
|
---|
| 307 | * is set to true. After previewing a deployment, you can deploy your resources
|
---|
| 308 | * by making a request with the `update()` or you can `cancelPreview()` to
|
---|
| 309 | * remove the preview altogether. Note that the deployment will still exist
|
---|
| 310 | * after you cancel the preview and you must separately delete this deployment
|
---|
| 311 | * if you want to remove it.
|
---|
| 312 | * @return Operation
|
---|
| 313 | * @throws \Google\Service\Exception
|
---|
| 314 | */
|
---|
| 315 | public function update($project, $deployment, Deployment $postBody, $optParams = [])
|
---|
| 316 | {
|
---|
| 317 | $params = ['project' => $project, 'deployment' => $deployment, 'postBody' => $postBody];
|
---|
| 318 | $params = array_merge($params, $optParams);
|
---|
| 319 | return $this->call('update', [$params], Operation::class);
|
---|
| 320 | }
|
---|
| 321 | }
|
---|
| 322 |
|
---|
| 323 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 324 | class_alias(Deployments::class, 'Google_Service_DeploymentManager_Resource_Deployments');
|
---|