[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\Compute\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Compute\AccessConfig;
|
---|
| 21 | use Google\Service\Compute\AttachedDisk;
|
---|
| 22 | use Google\Service\Compute\BulkInsertInstanceResource;
|
---|
| 23 | use Google\Service\Compute\DisplayDevice;
|
---|
| 24 | use Google\Service\Compute\GuestAttributes;
|
---|
| 25 | use Google\Service\Compute\Instance;
|
---|
| 26 | use Google\Service\Compute\InstanceAggregatedList;
|
---|
| 27 | use Google\Service\Compute\InstanceList;
|
---|
| 28 | use Google\Service\Compute\InstanceListReferrers;
|
---|
| 29 | use Google\Service\Compute\InstancesAddResourcePoliciesRequest;
|
---|
| 30 | use Google\Service\Compute\InstancesGetEffectiveFirewallsResponse;
|
---|
| 31 | use Google\Service\Compute\InstancesRemoveResourcePoliciesRequest;
|
---|
| 32 | use Google\Service\Compute\InstancesSetLabelsRequest;
|
---|
| 33 | use Google\Service\Compute\InstancesSetMachineResourcesRequest;
|
---|
| 34 | use Google\Service\Compute\InstancesSetMachineTypeRequest;
|
---|
| 35 | use Google\Service\Compute\InstancesSetMinCpuPlatformRequest;
|
---|
| 36 | use Google\Service\Compute\InstancesSetNameRequest;
|
---|
| 37 | use Google\Service\Compute\InstancesSetSecurityPolicyRequest;
|
---|
| 38 | use Google\Service\Compute\InstancesSetServiceAccountRequest;
|
---|
| 39 | use Google\Service\Compute\InstancesStartWithEncryptionKeyRequest;
|
---|
| 40 | use Google\Service\Compute\Metadata;
|
---|
| 41 | use Google\Service\Compute\NetworkInterface;
|
---|
| 42 | use Google\Service\Compute\Operation;
|
---|
| 43 | use Google\Service\Compute\Policy;
|
---|
| 44 | use Google\Service\Compute\Scheduling;
|
---|
| 45 | use Google\Service\Compute\Screenshot;
|
---|
| 46 | use Google\Service\Compute\SerialPortOutput;
|
---|
| 47 | use Google\Service\Compute\ShieldedInstanceConfig;
|
---|
| 48 | use Google\Service\Compute\ShieldedInstanceIdentity;
|
---|
| 49 | use Google\Service\Compute\ShieldedInstanceIntegrityPolicy;
|
---|
| 50 | use Google\Service\Compute\Tags;
|
---|
| 51 | use Google\Service\Compute\TestPermissionsRequest;
|
---|
| 52 | use Google\Service\Compute\TestPermissionsResponse;
|
---|
| 53 | use Google\Service\Compute\ZoneSetPolicyRequest;
|
---|
| 54 |
|
---|
| 55 | /**
|
---|
| 56 | * The "instances" collection of methods.
|
---|
| 57 | * Typical usage is:
|
---|
| 58 | * <code>
|
---|
| 59 | * $computeService = new Google\Service\Compute(...);
|
---|
| 60 | * $instances = $computeService->instances;
|
---|
| 61 | * </code>
|
---|
| 62 | */
|
---|
| 63 | class Instances extends \Google\Service\Resource
|
---|
| 64 | {
|
---|
| 65 | /**
|
---|
| 66 | * Adds an access config to an instance's network interface.
|
---|
| 67 | * (instances.addAccessConfig)
|
---|
| 68 | *
|
---|
| 69 | * @param string $project Project ID for this request.
|
---|
| 70 | * @param string $zone The name of the zone for this request.
|
---|
| 71 | * @param string $instance The instance name for this request.
|
---|
| 72 | * @param string $networkInterface The name of the network interface to add to
|
---|
| 73 | * this instance.
|
---|
| 74 | * @param AccessConfig $postBody
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | *
|
---|
| 77 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 78 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 79 | * server will know to ignore the request if it has already been completed. For
|
---|
| 80 | * example, consider a situation where you make an initial request and the
|
---|
| 81 | * request times out. If you make the request again with the same request ID,
|
---|
| 82 | * the server can check if original operation with the same request ID was
|
---|
| 83 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 84 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 85 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 86 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 87 | * @return Operation
|
---|
| 88 | * @throws \Google\Service\Exception
|
---|
| 89 | */
|
---|
| 90 | public function addAccessConfig($project, $zone, $instance, $networkInterface, AccessConfig $postBody, $optParams = [])
|
---|
| 91 | {
|
---|
| 92 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'networkInterface' => $networkInterface, 'postBody' => $postBody];
|
---|
| 93 | $params = array_merge($params, $optParams);
|
---|
| 94 | return $this->call('addAccessConfig', [$params], Operation::class);
|
---|
| 95 | }
|
---|
| 96 | /**
|
---|
| 97 | * Adds existing resource policies to an instance. You can only add one policy
|
---|
| 98 | * right now which will be applied to this instance for scheduling live
|
---|
| 99 | * migrations. (instances.addResourcePolicies)
|
---|
| 100 | *
|
---|
| 101 | * @param string $project Project ID for this request.
|
---|
| 102 | * @param string $zone The name of the zone for this request.
|
---|
| 103 | * @param string $instance The instance name for this request.
|
---|
| 104 | * @param InstancesAddResourcePoliciesRequest $postBody
|
---|
| 105 | * @param array $optParams Optional parameters.
|
---|
| 106 | *
|
---|
| 107 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 108 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 109 | * server will know to ignore the request if it has already been completed. For
|
---|
| 110 | * example, consider a situation where you make an initial request and the
|
---|
| 111 | * request times out. If you make the request again with the same request ID,
|
---|
| 112 | * the server can check if original operation with the same request ID was
|
---|
| 113 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 114 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 115 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 116 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 117 | * @return Operation
|
---|
| 118 | * @throws \Google\Service\Exception
|
---|
| 119 | */
|
---|
| 120 | public function addResourcePolicies($project, $zone, $instance, InstancesAddResourcePoliciesRequest $postBody, $optParams = [])
|
---|
| 121 | {
|
---|
| 122 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 123 | $params = array_merge($params, $optParams);
|
---|
| 124 | return $this->call('addResourcePolicies', [$params], Operation::class);
|
---|
| 125 | }
|
---|
| 126 | /**
|
---|
| 127 | * Retrieves an aggregated list of all of the instances in your project across
|
---|
| 128 | * all regions and zones. The performance of this method degrades when a filter
|
---|
| 129 | * is specified on a project that has a very large number of instances. To
|
---|
| 130 | * prevent failure, Google recommends that you set the `returnPartialSuccess`
|
---|
| 131 | * parameter to `true`. (instances.aggregatedList)
|
---|
| 132 | *
|
---|
| 133 | * @param string $project Project ID for this request.
|
---|
| 134 | * @param array $optParams Optional parameters.
|
---|
| 135 | *
|
---|
| 136 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 137 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 138 | * expressions that support regular expressions and expressions that follow API
|
---|
| 139 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 140 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 141 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 142 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 143 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 144 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 145 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 146 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 147 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 148 | * also filter nested fields. For example, you could specify
|
---|
| 149 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 150 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 151 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 152 | * provide each separate expression within parentheses. For example: ```
|
---|
| 153 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 154 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 155 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 156 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 157 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 158 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 159 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 160 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 161 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 162 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 163 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 164 | * literal value must match the entire field. For example, to filter for
|
---|
| 165 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 166 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 167 | * expressions.
|
---|
| 168 | * @opt_param bool includeAllScopes Indicates whether every visible scope for
|
---|
| 169 | * each scope type (zone, region, global) should be included in the response.
|
---|
| 170 | * For new resource types added after this field, the flag has no effect as new
|
---|
| 171 | * resource types will always include every visible scope for each scope type in
|
---|
| 172 | * response. For resource types which predate this field, if this flag is
|
---|
| 173 | * omitted or false, only scopes of the scope types where the resource type is
|
---|
| 174 | * expected to be found will be included.
|
---|
| 175 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 176 | * should be returned. If the number of available results is larger than
|
---|
| 177 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 178 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 179 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 180 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 181 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 182 | * can also sort results in descending order based on the creation timestamp
|
---|
| 183 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 184 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 185 | * first). Use this to sort resources like operations so that the newest
|
---|
| 186 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 187 | * `creationTimestamp desc` is supported.
|
---|
| 188 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 189 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 190 | * of results.
|
---|
| 191 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
| 192 | * which provides partial results in case of failure. The default value is
|
---|
| 193 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
| 194 | * for a single zone scope either returns all resources in the zone or no
|
---|
| 195 | * resources, with an error code.
|
---|
| 196 | * @opt_param string serviceProjectNumber The Shared VPC service project id or
|
---|
| 197 | * service project number for which aggregated list request is invoked for
|
---|
| 198 | * subnetworks list-usable api.
|
---|
| 199 | * @return InstanceAggregatedList
|
---|
| 200 | * @throws \Google\Service\Exception
|
---|
| 201 | */
|
---|
| 202 | public function aggregatedList($project, $optParams = [])
|
---|
| 203 | {
|
---|
| 204 | $params = ['project' => $project];
|
---|
| 205 | $params = array_merge($params, $optParams);
|
---|
| 206 | return $this->call('aggregatedList', [$params], InstanceAggregatedList::class);
|
---|
| 207 | }
|
---|
| 208 | /**
|
---|
| 209 | * Attaches an existing Disk resource to an instance. You must first create the
|
---|
| 210 | * disk before you can attach it. It is not possible to create and attach a disk
|
---|
| 211 | * at the same time. For more information, read Adding a persistent disk to your
|
---|
| 212 | * instance. (instances.attachDisk)
|
---|
| 213 | *
|
---|
| 214 | * @param string $project Project ID for this request.
|
---|
| 215 | * @param string $zone The name of the zone for this request.
|
---|
| 216 | * @param string $instance The instance name for this request.
|
---|
| 217 | * @param AttachedDisk $postBody
|
---|
| 218 | * @param array $optParams Optional parameters.
|
---|
| 219 | *
|
---|
| 220 | * @opt_param bool forceAttach Whether to force attach the regional disk even if
|
---|
| 221 | * it's currently attached to another instance. If you try to force attach a
|
---|
| 222 | * zonal disk to an instance, you will receive an error.
|
---|
| 223 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 224 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 225 | * server will know to ignore the request if it has already been completed. For
|
---|
| 226 | * example, consider a situation where you make an initial request and the
|
---|
| 227 | * request times out. If you make the request again with the same request ID,
|
---|
| 228 | * the server can check if original operation with the same request ID was
|
---|
| 229 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 230 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 231 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 232 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 233 | * @return Operation
|
---|
| 234 | * @throws \Google\Service\Exception
|
---|
| 235 | */
|
---|
| 236 | public function attachDisk($project, $zone, $instance, AttachedDisk $postBody, $optParams = [])
|
---|
| 237 | {
|
---|
| 238 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 239 | $params = array_merge($params, $optParams);
|
---|
| 240 | return $this->call('attachDisk', [$params], Operation::class);
|
---|
| 241 | }
|
---|
| 242 | /**
|
---|
| 243 | * Creates multiple instances. Count specifies the number of instances to
|
---|
| 244 | * create. For more information, see About bulk creation of VMs.
|
---|
| 245 | * (instances.bulkInsert)
|
---|
| 246 | *
|
---|
| 247 | * @param string $project Project ID for this request.
|
---|
| 248 | * @param string $zone The name of the zone for this request.
|
---|
| 249 | * @param BulkInsertInstanceResource $postBody
|
---|
| 250 | * @param array $optParams Optional parameters.
|
---|
| 251 | *
|
---|
| 252 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 253 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 254 | * server will know to ignore the request if it has already been completed. For
|
---|
| 255 | * example, consider a situation where you make an initial request and the
|
---|
| 256 | * request times out. If you make the request again with the same request ID,
|
---|
| 257 | * the server can check if original operation with the same request ID was
|
---|
| 258 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 259 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 260 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 261 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 262 | * @return Operation
|
---|
| 263 | * @throws \Google\Service\Exception
|
---|
| 264 | */
|
---|
| 265 | public function bulkInsert($project, $zone, BulkInsertInstanceResource $postBody, $optParams = [])
|
---|
| 266 | {
|
---|
| 267 | $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
|
---|
| 268 | $params = array_merge($params, $optParams);
|
---|
| 269 | return $this->call('bulkInsert', [$params], Operation::class);
|
---|
| 270 | }
|
---|
| 271 | /**
|
---|
| 272 | * Deletes the specified Instance resource. For more information, see Deleting
|
---|
| 273 | * an instance. (instances.delete)
|
---|
| 274 | *
|
---|
| 275 | * @param string $project Project ID for this request.
|
---|
| 276 | * @param string $zone The name of the zone for this request.
|
---|
| 277 | * @param string $instance Name of the instance resource to delete.
|
---|
| 278 | * @param array $optParams Optional parameters.
|
---|
| 279 | *
|
---|
| 280 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 281 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 282 | * server will know to ignore the request if it has already been completed. For
|
---|
| 283 | * example, consider a situation where you make an initial request and the
|
---|
| 284 | * request times out. If you make the request again with the same request ID,
|
---|
| 285 | * the server can check if original operation with the same request ID was
|
---|
| 286 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 287 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 288 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 289 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 290 | * @return Operation
|
---|
| 291 | * @throws \Google\Service\Exception
|
---|
| 292 | */
|
---|
| 293 | public function delete($project, $zone, $instance, $optParams = [])
|
---|
| 294 | {
|
---|
| 295 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 296 | $params = array_merge($params, $optParams);
|
---|
| 297 | return $this->call('delete', [$params], Operation::class);
|
---|
| 298 | }
|
---|
| 299 | /**
|
---|
| 300 | * Deletes an access config from an instance's network interface.
|
---|
| 301 | * (instances.deleteAccessConfig)
|
---|
| 302 | *
|
---|
| 303 | * @param string $project Project ID for this request.
|
---|
| 304 | * @param string $zone The name of the zone for this request.
|
---|
| 305 | * @param string $instance The instance name for this request.
|
---|
| 306 | * @param string $accessConfig The name of the access config to delete.
|
---|
| 307 | * @param string $networkInterface The name of the network interface.
|
---|
| 308 | * @param array $optParams Optional parameters.
|
---|
| 309 | *
|
---|
| 310 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 311 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 312 | * server will know to ignore the request if it has already been completed. For
|
---|
| 313 | * example, consider a situation where you make an initial request and the
|
---|
| 314 | * request times out. If you make the request again with the same request ID,
|
---|
| 315 | * the server can check if original operation with the same request ID was
|
---|
| 316 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 317 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 318 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 319 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 320 | * @return Operation
|
---|
| 321 | * @throws \Google\Service\Exception
|
---|
| 322 | */
|
---|
| 323 | public function deleteAccessConfig($project, $zone, $instance, $accessConfig, $networkInterface, $optParams = [])
|
---|
| 324 | {
|
---|
| 325 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'accessConfig' => $accessConfig, 'networkInterface' => $networkInterface];
|
---|
| 326 | $params = array_merge($params, $optParams);
|
---|
| 327 | return $this->call('deleteAccessConfig', [$params], Operation::class);
|
---|
| 328 | }
|
---|
| 329 | /**
|
---|
| 330 | * Detaches a disk from an instance. (instances.detachDisk)
|
---|
| 331 | *
|
---|
| 332 | * @param string $project Project ID for this request.
|
---|
| 333 | * @param string $zone The name of the zone for this request.
|
---|
| 334 | * @param string $instance Instance name for this request.
|
---|
| 335 | * @param string $deviceName The device name of the disk to detach. Make a get()
|
---|
| 336 | * request on the instance to view currently attached disks and device names.
|
---|
| 337 | * @param array $optParams Optional parameters.
|
---|
| 338 | *
|
---|
| 339 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 340 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 341 | * server will know to ignore the request if it has already been completed. For
|
---|
| 342 | * example, consider a situation where you make an initial request and the
|
---|
| 343 | * request times out. If you make the request again with the same request ID,
|
---|
| 344 | * the server can check if original operation with the same request ID was
|
---|
| 345 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 346 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 347 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 348 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 349 | * @return Operation
|
---|
| 350 | * @throws \Google\Service\Exception
|
---|
| 351 | */
|
---|
| 352 | public function detachDisk($project, $zone, $instance, $deviceName, $optParams = [])
|
---|
| 353 | {
|
---|
| 354 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'deviceName' => $deviceName];
|
---|
| 355 | $params = array_merge($params, $optParams);
|
---|
| 356 | return $this->call('detachDisk', [$params], Operation::class);
|
---|
| 357 | }
|
---|
| 358 | /**
|
---|
| 359 | * Returns the specified Instance resource. (instances.get)
|
---|
| 360 | *
|
---|
| 361 | * @param string $project Project ID for this request.
|
---|
| 362 | * @param string $zone The name of the zone for this request.
|
---|
| 363 | * @param string $instance Name of the instance resource to return.
|
---|
| 364 | * @param array $optParams Optional parameters.
|
---|
| 365 | * @return Instance
|
---|
| 366 | * @throws \Google\Service\Exception
|
---|
| 367 | */
|
---|
| 368 | public function get($project, $zone, $instance, $optParams = [])
|
---|
| 369 | {
|
---|
| 370 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 371 | $params = array_merge($params, $optParams);
|
---|
| 372 | return $this->call('get', [$params], Instance::class);
|
---|
| 373 | }
|
---|
| 374 | /**
|
---|
| 375 | * Returns effective firewalls applied to an interface of the instance.
|
---|
| 376 | * (instances.getEffectiveFirewalls)
|
---|
| 377 | *
|
---|
| 378 | * @param string $project Project ID for this request.
|
---|
| 379 | * @param string $zone The name of the zone for this request.
|
---|
| 380 | * @param string $instance Name of the instance scoping this request.
|
---|
| 381 | * @param string $networkInterface The name of the network interface to get the
|
---|
| 382 | * effective firewalls.
|
---|
| 383 | * @param array $optParams Optional parameters.
|
---|
| 384 | * @return InstancesGetEffectiveFirewallsResponse
|
---|
| 385 | * @throws \Google\Service\Exception
|
---|
| 386 | */
|
---|
| 387 | public function getEffectiveFirewalls($project, $zone, $instance, $networkInterface, $optParams = [])
|
---|
| 388 | {
|
---|
| 389 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'networkInterface' => $networkInterface];
|
---|
| 390 | $params = array_merge($params, $optParams);
|
---|
| 391 | return $this->call('getEffectiveFirewalls', [$params], InstancesGetEffectiveFirewallsResponse::class);
|
---|
| 392 | }
|
---|
| 393 | /**
|
---|
| 394 | * Returns the specified guest attributes entry. (instances.getGuestAttributes)
|
---|
| 395 | *
|
---|
| 396 | * @param string $project Project ID for this request.
|
---|
| 397 | * @param string $zone The name of the zone for this request.
|
---|
| 398 | * @param string $instance Name of the instance scoping this request.
|
---|
| 399 | * @param array $optParams Optional parameters.
|
---|
| 400 | *
|
---|
| 401 | * @opt_param string queryPath Specifies the guest attributes path to be
|
---|
| 402 | * queried.
|
---|
| 403 | * @opt_param string variableKey Specifies the key for the guest attributes
|
---|
| 404 | * entry.
|
---|
| 405 | * @return GuestAttributes
|
---|
| 406 | * @throws \Google\Service\Exception
|
---|
| 407 | */
|
---|
| 408 | public function getGuestAttributes($project, $zone, $instance, $optParams = [])
|
---|
| 409 | {
|
---|
| 410 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 411 | $params = array_merge($params, $optParams);
|
---|
| 412 | return $this->call('getGuestAttributes', [$params], GuestAttributes::class);
|
---|
| 413 | }
|
---|
| 414 | /**
|
---|
| 415 | * Gets the access control policy for a resource. May be empty if no such policy
|
---|
| 416 | * or resource exists. (instances.getIamPolicy)
|
---|
| 417 | *
|
---|
| 418 | * @param string $project Project ID for this request.
|
---|
| 419 | * @param string $zone The name of the zone for this request.
|
---|
| 420 | * @param string $resource Name or id of the resource for this request.
|
---|
| 421 | * @param array $optParams Optional parameters.
|
---|
| 422 | *
|
---|
| 423 | * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
|
---|
| 424 | * @return Policy
|
---|
| 425 | * @throws \Google\Service\Exception
|
---|
| 426 | */
|
---|
| 427 | public function getIamPolicy($project, $zone, $resource, $optParams = [])
|
---|
| 428 | {
|
---|
| 429 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource];
|
---|
| 430 | $params = array_merge($params, $optParams);
|
---|
| 431 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 432 | }
|
---|
| 433 | /**
|
---|
| 434 | * Returns the screenshot from the specified instance. (instances.getScreenshot)
|
---|
| 435 | *
|
---|
| 436 | * @param string $project Project ID for this request.
|
---|
| 437 | * @param string $zone The name of the zone for this request.
|
---|
| 438 | * @param string $instance Name of the instance scoping this request.
|
---|
| 439 | * @param array $optParams Optional parameters.
|
---|
| 440 | * @return Screenshot
|
---|
| 441 | * @throws \Google\Service\Exception
|
---|
| 442 | */
|
---|
| 443 | public function getScreenshot($project, $zone, $instance, $optParams = [])
|
---|
| 444 | {
|
---|
| 445 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 446 | $params = array_merge($params, $optParams);
|
---|
| 447 | return $this->call('getScreenshot', [$params], Screenshot::class);
|
---|
| 448 | }
|
---|
| 449 | /**
|
---|
| 450 | * Returns the last 1 MB of serial port output from the specified instance.
|
---|
| 451 | * (instances.getSerialPortOutput)
|
---|
| 452 | *
|
---|
| 453 | * @param string $project Project ID for this request.
|
---|
| 454 | * @param string $zone The name of the zone for this request.
|
---|
| 455 | * @param string $instance Name of the instance for this request.
|
---|
| 456 | * @param array $optParams Optional parameters.
|
---|
| 457 | *
|
---|
| 458 | * @opt_param int port Specifies which COM or serial port to retrieve data from.
|
---|
| 459 | * @opt_param string start Specifies the starting byte position of the output to
|
---|
| 460 | * return. To start with the first byte of output to the specified port, omit
|
---|
| 461 | * this field or set it to `0`. If the output for that byte position is
|
---|
| 462 | * available, this field matches the `start` parameter sent with the request. If
|
---|
| 463 | * the amount of serial console output exceeds the size of the buffer (1 MB),
|
---|
| 464 | * the oldest output is discarded and is no longer available. If the requested
|
---|
| 465 | * start position refers to discarded output, the start position is adjusted to
|
---|
| 466 | * the oldest output still available, and the adjusted start position is
|
---|
| 467 | * returned as the `start` property value. You can also provide a negative start
|
---|
| 468 | * position, which translates to the most recent number of bytes written to the
|
---|
| 469 | * serial port. For example, -3 is interpreted as the most recent 3 bytes
|
---|
| 470 | * written to the serial console.
|
---|
| 471 | * @return SerialPortOutput
|
---|
| 472 | * @throws \Google\Service\Exception
|
---|
| 473 | */
|
---|
| 474 | public function getSerialPortOutput($project, $zone, $instance, $optParams = [])
|
---|
| 475 | {
|
---|
| 476 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 477 | $params = array_merge($params, $optParams);
|
---|
| 478 | return $this->call('getSerialPortOutput', [$params], SerialPortOutput::class);
|
---|
| 479 | }
|
---|
| 480 | /**
|
---|
| 481 | * Returns the Shielded Instance Identity of an instance
|
---|
| 482 | * (instances.getShieldedInstanceIdentity)
|
---|
| 483 | *
|
---|
| 484 | * @param string $project Project ID for this request.
|
---|
| 485 | * @param string $zone The name of the zone for this request.
|
---|
| 486 | * @param string $instance Name or id of the instance scoping this request.
|
---|
| 487 | * @param array $optParams Optional parameters.
|
---|
| 488 | * @return ShieldedInstanceIdentity
|
---|
| 489 | * @throws \Google\Service\Exception
|
---|
| 490 | */
|
---|
| 491 | public function getShieldedInstanceIdentity($project, $zone, $instance, $optParams = [])
|
---|
| 492 | {
|
---|
| 493 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 494 | $params = array_merge($params, $optParams);
|
---|
| 495 | return $this->call('getShieldedInstanceIdentity', [$params], ShieldedInstanceIdentity::class);
|
---|
| 496 | }
|
---|
| 497 | /**
|
---|
| 498 | * Creates an instance resource in the specified project using the data included
|
---|
| 499 | * in the request. (instances.insert)
|
---|
| 500 | *
|
---|
| 501 | * @param string $project Project ID for this request.
|
---|
| 502 | * @param string $zone The name of the zone for this request.
|
---|
| 503 | * @param Instance $postBody
|
---|
| 504 | * @param array $optParams Optional parameters.
|
---|
| 505 | *
|
---|
| 506 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 507 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 508 | * server will know to ignore the request if it has already been completed. For
|
---|
| 509 | * example, consider a situation where you make an initial request and the
|
---|
| 510 | * request times out. If you make the request again with the same request ID,
|
---|
| 511 | * the server can check if original operation with the same request ID was
|
---|
| 512 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 513 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 514 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 515 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 516 | * @opt_param string sourceInstanceTemplate Specifies instance template to
|
---|
| 517 | * create the instance. This field is optional. It can be a full or partial URL.
|
---|
| 518 | * For example, the following are all valid URLs to an instance template: -
|
---|
| 519 | * https://www.googleapis.com/compute/v1/projects/project
|
---|
| 520 | * /global/instanceTemplates/instanceTemplate -
|
---|
| 521 | * projects/project/global/instanceTemplates/instanceTemplate -
|
---|
| 522 | * global/instanceTemplates/instanceTemplate
|
---|
| 523 | * @opt_param string sourceMachineImage Specifies the machine image to use to
|
---|
| 524 | * create the instance. This field is optional. It can be a full or partial URL.
|
---|
| 525 | * For example, the following are all valid URLs to a machine image: -
|
---|
| 526 | * https://www.googleapis.com/compute/v1/projects/project/global/global
|
---|
| 527 | * /machineImages/machineImage -
|
---|
| 528 | * projects/project/global/global/machineImages/machineImage -
|
---|
| 529 | * global/machineImages/machineImage
|
---|
| 530 | * @return Operation
|
---|
| 531 | * @throws \Google\Service\Exception
|
---|
| 532 | */
|
---|
| 533 | public function insert($project, $zone, Instance $postBody, $optParams = [])
|
---|
| 534 | {
|
---|
| 535 | $params = ['project' => $project, 'zone' => $zone, 'postBody' => $postBody];
|
---|
| 536 | $params = array_merge($params, $optParams);
|
---|
| 537 | return $this->call('insert', [$params], Operation::class);
|
---|
| 538 | }
|
---|
| 539 | /**
|
---|
| 540 | * Retrieves the list of instances contained within the specified zone.
|
---|
| 541 | * (instances.listInstances)
|
---|
| 542 | *
|
---|
| 543 | * @param string $project Project ID for this request.
|
---|
| 544 | * @param string $zone The name of the zone for this request.
|
---|
| 545 | * @param array $optParams Optional parameters.
|
---|
| 546 | *
|
---|
| 547 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 548 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 549 | * expressions that support regular expressions and expressions that follow API
|
---|
| 550 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 551 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 552 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 553 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 554 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 555 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 556 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 557 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 558 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 559 | * also filter nested fields. For example, you could specify
|
---|
| 560 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 561 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 562 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 563 | * provide each separate expression within parentheses. For example: ```
|
---|
| 564 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 565 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 566 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 567 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 568 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 569 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 570 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 571 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 572 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 573 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 574 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 575 | * literal value must match the entire field. For example, to filter for
|
---|
| 576 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 577 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 578 | * expressions.
|
---|
| 579 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 580 | * should be returned. If the number of available results is larger than
|
---|
| 581 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 582 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 583 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 584 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 585 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 586 | * can also sort results in descending order based on the creation timestamp
|
---|
| 587 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 588 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 589 | * first). Use this to sort resources like operations so that the newest
|
---|
| 590 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 591 | * `creationTimestamp desc` is supported.
|
---|
| 592 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 593 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 594 | * of results.
|
---|
| 595 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
| 596 | * which provides partial results in case of failure. The default value is
|
---|
| 597 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
| 598 | * for a single zone scope either returns all resources in the zone or no
|
---|
| 599 | * resources, with an error code.
|
---|
| 600 | * @return InstanceList
|
---|
| 601 | * @throws \Google\Service\Exception
|
---|
| 602 | */
|
---|
| 603 | public function listInstances($project, $zone, $optParams = [])
|
---|
| 604 | {
|
---|
| 605 | $params = ['project' => $project, 'zone' => $zone];
|
---|
| 606 | $params = array_merge($params, $optParams);
|
---|
| 607 | return $this->call('list', [$params], InstanceList::class);
|
---|
| 608 | }
|
---|
| 609 | /**
|
---|
| 610 | * Retrieves a list of resources that refer to the VM instance specified in the
|
---|
| 611 | * request. For example, if the VM instance is part of a managed or unmanaged
|
---|
| 612 | * instance group, the referrers list includes the instance group. For more
|
---|
| 613 | * information, read Viewing referrers to VM instances.
|
---|
| 614 | * (instances.listReferrers)
|
---|
| 615 | *
|
---|
| 616 | * @param string $project Project ID for this request.
|
---|
| 617 | * @param string $zone The name of the zone for this request.
|
---|
| 618 | * @param string $instance Name of the target instance scoping this request, or
|
---|
| 619 | * '-' if the request should span over all instances in the container.
|
---|
| 620 | * @param array $optParams Optional parameters.
|
---|
| 621 | *
|
---|
| 622 | * @opt_param string filter A filter expression that filters resources listed in
|
---|
| 623 | * the response. Most Compute resources support two types of filter expressions:
|
---|
| 624 | * expressions that support regular expressions and expressions that follow API
|
---|
| 625 | * improvement proposal AIP-160. These two types of filter expressions cannot be
|
---|
| 626 | * mixed in one request. If you want to use AIP-160, your expression must
|
---|
| 627 | * specify the field name, an operator, and the value that you want to use for
|
---|
| 628 | * filtering. The value must be a string, a number, or a boolean. The operator
|
---|
| 629 | * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
|
---|
| 630 | * are filtering Compute Engine instances, you can exclude instances named
|
---|
| 631 | * `example-instance` by specifying `name != example-instance`. The `:*`
|
---|
| 632 | * comparison can be used to test whether a key has been defined. For example,
|
---|
| 633 | * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
|
---|
| 634 | * also filter nested fields. For example, you could specify
|
---|
| 635 | * `scheduling.automaticRestart = false` to include instances only if they are
|
---|
| 636 | * not scheduled for automatic restarts. You can use filtering on nested fields
|
---|
| 637 | * to filter based on resource labels. To filter on multiple expressions,
|
---|
| 638 | * provide each separate expression within parentheses. For example: ```
|
---|
| 639 | * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
|
---|
| 640 | * default, each expression is an `AND` expression. However, you can include
|
---|
| 641 | * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
|
---|
| 642 | * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
|
---|
| 643 | * (scheduling.automaticRestart = true) ``` If you want to use a regular
|
---|
| 644 | * expression, use the `eq` (equal) or `ne` (not equal) operator against a
|
---|
| 645 | * single un-parenthesized expression with or without quotes or against multiple
|
---|
| 646 | * parenthesized expressions. Examples: `fieldname eq unquoted literal`
|
---|
| 647 | * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
|
---|
| 648 | * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
|
---|
| 649 | * interpreted as a regular expression using Google RE2 library syntax. The
|
---|
| 650 | * literal value must match the entire field. For example, to filter for
|
---|
| 651 | * instances that do not end with name "instance", you would use `name ne
|
---|
| 652 | * .*instance`. You cannot combine constraints on multiple fields using regular
|
---|
| 653 | * expressions.
|
---|
| 654 | * @opt_param string maxResults The maximum number of results per page that
|
---|
| 655 | * should be returned. If the number of available results is larger than
|
---|
| 656 | * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
|
---|
| 657 | * get the next page of results in subsequent list requests. Acceptable values
|
---|
| 658 | * are `0` to `500`, inclusive. (Default: `500`)
|
---|
| 659 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
| 660 | * results are returned in alphanumerical order based on the resource name. You
|
---|
| 661 | * can also sort results in descending order based on the creation timestamp
|
---|
| 662 | * using `orderBy="creationTimestamp desc"`. This sorts results based on the
|
---|
| 663 | * `creationTimestamp` field in reverse chronological order (newest result
|
---|
| 664 | * first). Use this to sort resources like operations so that the newest
|
---|
| 665 | * operation is returned first. Currently, only sorting by `name` or
|
---|
| 666 | * `creationTimestamp desc` is supported.
|
---|
| 667 | * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
|
---|
| 668 | * the `nextPageToken` returned by a previous list request to get the next page
|
---|
| 669 | * of results.
|
---|
| 670 | * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
|
---|
| 671 | * which provides partial results in case of failure. The default value is
|
---|
| 672 | * false. For example, when partial success behavior is enabled, aggregatedList
|
---|
| 673 | * for a single zone scope either returns all resources in the zone or no
|
---|
| 674 | * resources, with an error code.
|
---|
| 675 | * @return InstanceListReferrers
|
---|
| 676 | * @throws \Google\Service\Exception
|
---|
| 677 | */
|
---|
| 678 | public function listReferrers($project, $zone, $instance, $optParams = [])
|
---|
| 679 | {
|
---|
| 680 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 681 | $params = array_merge($params, $optParams);
|
---|
| 682 | return $this->call('listReferrers', [$params], InstanceListReferrers::class);
|
---|
| 683 | }
|
---|
| 684 | /**
|
---|
| 685 | * Perform a manual maintenance on the instance. (instances.performMaintenance)
|
---|
| 686 | *
|
---|
| 687 | * @param string $project Project ID for this request.
|
---|
| 688 | * @param string $zone The name of the zone for this request.
|
---|
| 689 | * @param string $instance Name of the instance scoping this request.
|
---|
| 690 | * @param array $optParams Optional parameters.
|
---|
| 691 | *
|
---|
| 692 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 693 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 694 | * server will know to ignore the request if it has already been completed. For
|
---|
| 695 | * example, consider a situation where you make an initial request and the
|
---|
| 696 | * request times out. If you make the request again with the same request ID,
|
---|
| 697 | * the server can check if original operation with the same request ID was
|
---|
| 698 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 699 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 700 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 701 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 702 | * @return Operation
|
---|
| 703 | * @throws \Google\Service\Exception
|
---|
| 704 | */
|
---|
| 705 | public function performMaintenance($project, $zone, $instance, $optParams = [])
|
---|
| 706 | {
|
---|
| 707 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 708 | $params = array_merge($params, $optParams);
|
---|
| 709 | return $this->call('performMaintenance', [$params], Operation::class);
|
---|
| 710 | }
|
---|
| 711 | /**
|
---|
| 712 | * Removes resource policies from an instance.
|
---|
| 713 | * (instances.removeResourcePolicies)
|
---|
| 714 | *
|
---|
| 715 | * @param string $project Project ID for this request.
|
---|
| 716 | * @param string $zone The name of the zone for this request.
|
---|
| 717 | * @param string $instance The instance name for this request.
|
---|
| 718 | * @param InstancesRemoveResourcePoliciesRequest $postBody
|
---|
| 719 | * @param array $optParams Optional parameters.
|
---|
| 720 | *
|
---|
| 721 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 722 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 723 | * server will know to ignore the request if it has already been completed. For
|
---|
| 724 | * example, consider a situation where you make an initial request and the
|
---|
| 725 | * request times out. If you make the request again with the same request ID,
|
---|
| 726 | * the server can check if original operation with the same request ID was
|
---|
| 727 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 728 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 729 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 730 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 731 | * @return Operation
|
---|
| 732 | * @throws \Google\Service\Exception
|
---|
| 733 | */
|
---|
| 734 | public function removeResourcePolicies($project, $zone, $instance, InstancesRemoveResourcePoliciesRequest $postBody, $optParams = [])
|
---|
| 735 | {
|
---|
| 736 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 737 | $params = array_merge($params, $optParams);
|
---|
| 738 | return $this->call('removeResourcePolicies', [$params], Operation::class);
|
---|
| 739 | }
|
---|
| 740 | /**
|
---|
| 741 | * Performs a reset on the instance. This is a hard reset. The VM does not do a
|
---|
| 742 | * graceful shutdown. For more information, see Resetting an instance.
|
---|
| 743 | * (instances.reset)
|
---|
| 744 | *
|
---|
| 745 | * @param string $project Project ID for this request.
|
---|
| 746 | * @param string $zone The name of the zone for this request.
|
---|
| 747 | * @param string $instance Name of the instance scoping this request.
|
---|
| 748 | * @param array $optParams Optional parameters.
|
---|
| 749 | *
|
---|
| 750 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 751 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 752 | * server will know to ignore the request if it has already been completed. For
|
---|
| 753 | * example, consider a situation where you make an initial request and the
|
---|
| 754 | * request times out. If you make the request again with the same request ID,
|
---|
| 755 | * the server can check if original operation with the same request ID was
|
---|
| 756 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 757 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 758 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 759 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 760 | * @return Operation
|
---|
| 761 | * @throws \Google\Service\Exception
|
---|
| 762 | */
|
---|
| 763 | public function reset($project, $zone, $instance, $optParams = [])
|
---|
| 764 | {
|
---|
| 765 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 766 | $params = array_merge($params, $optParams);
|
---|
| 767 | return $this->call('reset', [$params], Operation::class);
|
---|
| 768 | }
|
---|
| 769 | /**
|
---|
| 770 | * Resumes an instance that was suspended using the instances().suspend method.
|
---|
| 771 | * (instances.resume)
|
---|
| 772 | *
|
---|
| 773 | * @param string $project Project ID for this request.
|
---|
| 774 | * @param string $zone The name of the zone for this request.
|
---|
| 775 | * @param string $instance Name of the instance resource to resume.
|
---|
| 776 | * @param array $optParams Optional parameters.
|
---|
| 777 | *
|
---|
| 778 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 779 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 780 | * server will know to ignore the request if it has already been completed. For
|
---|
| 781 | * example, consider a situation where you make an initial request and the
|
---|
| 782 | * request times out. If you make the request again with the same request ID,
|
---|
| 783 | * the server can check if original operation with the same request ID was
|
---|
| 784 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 785 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 786 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 787 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 788 | * @return Operation
|
---|
| 789 | * @throws \Google\Service\Exception
|
---|
| 790 | */
|
---|
| 791 | public function resume($project, $zone, $instance, $optParams = [])
|
---|
| 792 | {
|
---|
| 793 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 794 | $params = array_merge($params, $optParams);
|
---|
| 795 | return $this->call('resume', [$params], Operation::class);
|
---|
| 796 | }
|
---|
| 797 | /**
|
---|
| 798 | * Sends diagnostic interrupt to the instance.
|
---|
| 799 | * (instances.sendDiagnosticInterrupt)
|
---|
| 800 | *
|
---|
| 801 | * @param string $project Project ID for this request.
|
---|
| 802 | * @param string $zone The name of the zone for this request.
|
---|
| 803 | * @param string $instance Name of the instance scoping this request.
|
---|
| 804 | * @param array $optParams Optional parameters.
|
---|
| 805 | * @throws \Google\Service\Exception
|
---|
| 806 | */
|
---|
| 807 | public function sendDiagnosticInterrupt($project, $zone, $instance, $optParams = [])
|
---|
| 808 | {
|
---|
| 809 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 810 | $params = array_merge($params, $optParams);
|
---|
| 811 | return $this->call('sendDiagnosticInterrupt', [$params]);
|
---|
| 812 | }
|
---|
| 813 | /**
|
---|
| 814 | * Sets deletion protection on the instance. (instances.setDeletionProtection)
|
---|
| 815 | *
|
---|
| 816 | * @param string $project Project ID for this request.
|
---|
| 817 | * @param string $zone The name of the zone for this request.
|
---|
| 818 | * @param string $resource Name or id of the resource for this request.
|
---|
| 819 | * @param array $optParams Optional parameters.
|
---|
| 820 | *
|
---|
| 821 | * @opt_param bool deletionProtection Whether the resource should be protected
|
---|
| 822 | * against deletion.
|
---|
| 823 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 824 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 825 | * server will know to ignore the request if it has already been completed. For
|
---|
| 826 | * example, consider a situation where you make an initial request and the
|
---|
| 827 | * request times out. If you make the request again with the same request ID,
|
---|
| 828 | * the server can check if original operation with the same request ID was
|
---|
| 829 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 830 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 831 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 832 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 833 | * @return Operation
|
---|
| 834 | * @throws \Google\Service\Exception
|
---|
| 835 | */
|
---|
| 836 | public function setDeletionProtection($project, $zone, $resource, $optParams = [])
|
---|
| 837 | {
|
---|
| 838 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource];
|
---|
| 839 | $params = array_merge($params, $optParams);
|
---|
| 840 | return $this->call('setDeletionProtection', [$params], Operation::class);
|
---|
| 841 | }
|
---|
| 842 | /**
|
---|
| 843 | * Sets the auto-delete flag for a disk attached to an instance.
|
---|
| 844 | * (instances.setDiskAutoDelete)
|
---|
| 845 | *
|
---|
| 846 | * @param string $project Project ID for this request.
|
---|
| 847 | * @param string $zone The name of the zone for this request.
|
---|
| 848 | * @param string $instance The instance name for this request.
|
---|
| 849 | * @param bool $autoDelete Whether to auto-delete the disk when the instance is
|
---|
| 850 | * deleted.
|
---|
| 851 | * @param string $deviceName The device name of the disk to modify. Make a get()
|
---|
| 852 | * request on the instance to view currently attached disks and device names.
|
---|
| 853 | * @param array $optParams Optional parameters.
|
---|
| 854 | *
|
---|
| 855 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 856 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 857 | * server will know to ignore the request if it has already been completed. For
|
---|
| 858 | * example, consider a situation where you make an initial request and the
|
---|
| 859 | * request times out. If you make the request again with the same request ID,
|
---|
| 860 | * the server can check if original operation with the same request ID was
|
---|
| 861 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 862 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 863 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 864 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 865 | * @return Operation
|
---|
| 866 | * @throws \Google\Service\Exception
|
---|
| 867 | */
|
---|
| 868 | public function setDiskAutoDelete($project, $zone, $instance, $autoDelete, $deviceName, $optParams = [])
|
---|
| 869 | {
|
---|
| 870 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'autoDelete' => $autoDelete, 'deviceName' => $deviceName];
|
---|
| 871 | $params = array_merge($params, $optParams);
|
---|
| 872 | return $this->call('setDiskAutoDelete', [$params], Operation::class);
|
---|
| 873 | }
|
---|
| 874 | /**
|
---|
| 875 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 876 | * existing policy. (instances.setIamPolicy)
|
---|
| 877 | *
|
---|
| 878 | * @param string $project Project ID for this request.
|
---|
| 879 | * @param string $zone The name of the zone for this request.
|
---|
| 880 | * @param string $resource Name or id of the resource for this request.
|
---|
| 881 | * @param ZoneSetPolicyRequest $postBody
|
---|
| 882 | * @param array $optParams Optional parameters.
|
---|
| 883 | * @return Policy
|
---|
| 884 | * @throws \Google\Service\Exception
|
---|
| 885 | */
|
---|
| 886 | public function setIamPolicy($project, $zone, $resource, ZoneSetPolicyRequest $postBody, $optParams = [])
|
---|
| 887 | {
|
---|
| 888 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 889 | $params = array_merge($params, $optParams);
|
---|
| 890 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 891 | }
|
---|
| 892 | /**
|
---|
| 893 | * Sets labels on an instance. To learn more about labels, read the Labeling
|
---|
| 894 | * Resources documentation. (instances.setLabels)
|
---|
| 895 | *
|
---|
| 896 | * @param string $project Project ID for this request.
|
---|
| 897 | * @param string $zone The name of the zone for this request.
|
---|
| 898 | * @param string $instance Name of the instance scoping this request.
|
---|
| 899 | * @param InstancesSetLabelsRequest $postBody
|
---|
| 900 | * @param array $optParams Optional parameters.
|
---|
| 901 | *
|
---|
| 902 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 903 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 904 | * server will know to ignore the request if it has already been completed. For
|
---|
| 905 | * example, consider a situation where you make an initial request and the
|
---|
| 906 | * request times out. If you make the request again with the same request ID,
|
---|
| 907 | * the server can check if original operation with the same request ID was
|
---|
| 908 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 909 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 910 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 911 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 912 | * @return Operation
|
---|
| 913 | * @throws \Google\Service\Exception
|
---|
| 914 | */
|
---|
| 915 | public function setLabels($project, $zone, $instance, InstancesSetLabelsRequest $postBody, $optParams = [])
|
---|
| 916 | {
|
---|
| 917 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 918 | $params = array_merge($params, $optParams);
|
---|
| 919 | return $this->call('setLabels', [$params], Operation::class);
|
---|
| 920 | }
|
---|
| 921 | /**
|
---|
| 922 | * Changes the number and/or type of accelerator for a stopped instance to the
|
---|
| 923 | * values specified in the request. (instances.setMachineResources)
|
---|
| 924 | *
|
---|
| 925 | * @param string $project Project ID for this request.
|
---|
| 926 | * @param string $zone The name of the zone for this request.
|
---|
| 927 | * @param string $instance Name of the instance scoping this request.
|
---|
| 928 | * @param InstancesSetMachineResourcesRequest $postBody
|
---|
| 929 | * @param array $optParams Optional parameters.
|
---|
| 930 | *
|
---|
| 931 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 932 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 933 | * server will know to ignore the request if it has already been completed. For
|
---|
| 934 | * example, consider a situation where you make an initial request and the
|
---|
| 935 | * request times out. If you make the request again with the same request ID,
|
---|
| 936 | * the server can check if original operation with the same request ID was
|
---|
| 937 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 938 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 939 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 940 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 941 | * @return Operation
|
---|
| 942 | * @throws \Google\Service\Exception
|
---|
| 943 | */
|
---|
| 944 | public function setMachineResources($project, $zone, $instance, InstancesSetMachineResourcesRequest $postBody, $optParams = [])
|
---|
| 945 | {
|
---|
| 946 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 947 | $params = array_merge($params, $optParams);
|
---|
| 948 | return $this->call('setMachineResources', [$params], Operation::class);
|
---|
| 949 | }
|
---|
| 950 | /**
|
---|
| 951 | * Changes the machine type for a stopped instance to the machine type specified
|
---|
| 952 | * in the request. (instances.setMachineType)
|
---|
| 953 | *
|
---|
| 954 | * @param string $project Project ID for this request.
|
---|
| 955 | * @param string $zone The name of the zone for this request.
|
---|
| 956 | * @param string $instance Name of the instance scoping this request.
|
---|
| 957 | * @param InstancesSetMachineTypeRequest $postBody
|
---|
| 958 | * @param array $optParams Optional parameters.
|
---|
| 959 | *
|
---|
| 960 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 961 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 962 | * server will know to ignore the request if it has already been completed. For
|
---|
| 963 | * example, consider a situation where you make an initial request and the
|
---|
| 964 | * request times out. If you make the request again with the same request ID,
|
---|
| 965 | * the server can check if original operation with the same request ID was
|
---|
| 966 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 967 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 968 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 969 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 970 | * @return Operation
|
---|
| 971 | * @throws \Google\Service\Exception
|
---|
| 972 | */
|
---|
| 973 | public function setMachineType($project, $zone, $instance, InstancesSetMachineTypeRequest $postBody, $optParams = [])
|
---|
| 974 | {
|
---|
| 975 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 976 | $params = array_merge($params, $optParams);
|
---|
| 977 | return $this->call('setMachineType', [$params], Operation::class);
|
---|
| 978 | }
|
---|
| 979 | /**
|
---|
| 980 | * Sets metadata for the specified instance to the data included in the request.
|
---|
| 981 | * (instances.setMetadata)
|
---|
| 982 | *
|
---|
| 983 | * @param string $project Project ID for this request.
|
---|
| 984 | * @param string $zone The name of the zone for this request.
|
---|
| 985 | * @param string $instance Name of the instance scoping this request.
|
---|
| 986 | * @param Metadata $postBody
|
---|
| 987 | * @param array $optParams Optional parameters.
|
---|
| 988 | *
|
---|
| 989 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 990 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 991 | * server will know to ignore the request if it has already been completed. For
|
---|
| 992 | * example, consider a situation where you make an initial request and the
|
---|
| 993 | * request times out. If you make the request again with the same request ID,
|
---|
| 994 | * the server can check if original operation with the same request ID was
|
---|
| 995 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 996 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 997 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 998 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 999 | * @return Operation
|
---|
| 1000 | * @throws \Google\Service\Exception
|
---|
| 1001 | */
|
---|
| 1002 | public function setMetadata($project, $zone, $instance, Metadata $postBody, $optParams = [])
|
---|
| 1003 | {
|
---|
| 1004 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1005 | $params = array_merge($params, $optParams);
|
---|
| 1006 | return $this->call('setMetadata', [$params], Operation::class);
|
---|
| 1007 | }
|
---|
| 1008 | /**
|
---|
| 1009 | * Changes the minimum CPU platform that this instance should use. This method
|
---|
| 1010 | * can only be called on a stopped instance. For more information, read
|
---|
| 1011 | * Specifying a Minimum CPU Platform. (instances.setMinCpuPlatform)
|
---|
| 1012 | *
|
---|
| 1013 | * @param string $project Project ID for this request.
|
---|
| 1014 | * @param string $zone The name of the zone for this request.
|
---|
| 1015 | * @param string $instance Name of the instance scoping this request.
|
---|
| 1016 | * @param InstancesSetMinCpuPlatformRequest $postBody
|
---|
| 1017 | * @param array $optParams Optional parameters.
|
---|
| 1018 | *
|
---|
| 1019 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1020 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1021 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1022 | * example, consider a situation where you make an initial request and the
|
---|
| 1023 | * request times out. If you make the request again with the same request ID,
|
---|
| 1024 | * the server can check if original operation with the same request ID was
|
---|
| 1025 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1026 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1027 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1028 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1029 | * @return Operation
|
---|
| 1030 | * @throws \Google\Service\Exception
|
---|
| 1031 | */
|
---|
| 1032 | public function setMinCpuPlatform($project, $zone, $instance, InstancesSetMinCpuPlatformRequest $postBody, $optParams = [])
|
---|
| 1033 | {
|
---|
| 1034 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1035 | $params = array_merge($params, $optParams);
|
---|
| 1036 | return $this->call('setMinCpuPlatform', [$params], Operation::class);
|
---|
| 1037 | }
|
---|
| 1038 | /**
|
---|
| 1039 | * Sets name of an instance. (instances.setName)
|
---|
| 1040 | *
|
---|
| 1041 | * @param string $project Project ID for this request.
|
---|
| 1042 | * @param string $zone The name of the zone for this request.
|
---|
| 1043 | * @param string $instance The instance name for this request.
|
---|
| 1044 | * @param InstancesSetNameRequest $postBody
|
---|
| 1045 | * @param array $optParams Optional parameters.
|
---|
| 1046 | *
|
---|
| 1047 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1048 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1049 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1050 | * example, consider a situation where you make an initial request and the
|
---|
| 1051 | * request times out. If you make the request again with the same request ID,
|
---|
| 1052 | * the server can check if original operation with the same request ID was
|
---|
| 1053 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1054 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1055 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1056 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1057 | * @return Operation
|
---|
| 1058 | * @throws \Google\Service\Exception
|
---|
| 1059 | */
|
---|
| 1060 | public function setName($project, $zone, $instance, InstancesSetNameRequest $postBody, $optParams = [])
|
---|
| 1061 | {
|
---|
| 1062 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1063 | $params = array_merge($params, $optParams);
|
---|
| 1064 | return $this->call('setName', [$params], Operation::class);
|
---|
| 1065 | }
|
---|
| 1066 | /**
|
---|
| 1067 | * Sets an instance's scheduling options. You can only call this method on a
|
---|
| 1068 | * stopped instance, that is, a VM instance that is in a `TERMINATED` state. See
|
---|
| 1069 | * Instance Life Cycle for more information on the possible instance states. For
|
---|
| 1070 | * more information about setting scheduling options for a VM, see Set VM host
|
---|
| 1071 | * maintenance policy. (instances.setScheduling)
|
---|
| 1072 | *
|
---|
| 1073 | * @param string $project Project ID for this request.
|
---|
| 1074 | * @param string $zone The name of the zone for this request.
|
---|
| 1075 | * @param string $instance Instance name for this request.
|
---|
| 1076 | * @param Scheduling $postBody
|
---|
| 1077 | * @param array $optParams Optional parameters.
|
---|
| 1078 | *
|
---|
| 1079 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1080 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1081 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1082 | * example, consider a situation where you make an initial request and the
|
---|
| 1083 | * request times out. If you make the request again with the same request ID,
|
---|
| 1084 | * the server can check if original operation with the same request ID was
|
---|
| 1085 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1086 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1087 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1088 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1089 | * @return Operation
|
---|
| 1090 | * @throws \Google\Service\Exception
|
---|
| 1091 | */
|
---|
| 1092 | public function setScheduling($project, $zone, $instance, Scheduling $postBody, $optParams = [])
|
---|
| 1093 | {
|
---|
| 1094 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1095 | $params = array_merge($params, $optParams);
|
---|
| 1096 | return $this->call('setScheduling', [$params], Operation::class);
|
---|
| 1097 | }
|
---|
| 1098 | /**
|
---|
| 1099 | * Sets the Google Cloud Armor security policy for the specified instance. For
|
---|
| 1100 | * more information, see Google Cloud Armor Overview
|
---|
| 1101 | * (instances.setSecurityPolicy)
|
---|
| 1102 | *
|
---|
| 1103 | * @param string $project Project ID for this request.
|
---|
| 1104 | * @param string $zone Name of the zone scoping this request.
|
---|
| 1105 | * @param string $instance Name of the Instance resource to which the security
|
---|
| 1106 | * policy should be set. The name should conform to RFC1035.
|
---|
| 1107 | * @param InstancesSetSecurityPolicyRequest $postBody
|
---|
| 1108 | * @param array $optParams Optional parameters.
|
---|
| 1109 | *
|
---|
| 1110 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1111 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1112 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1113 | * example, consider a situation where you make an initial request and the
|
---|
| 1114 | * request times out. If you make the request again with the same request ID,
|
---|
| 1115 | * the server can check if original operation with the same request ID was
|
---|
| 1116 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1117 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1118 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1119 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1120 | * @return Operation
|
---|
| 1121 | * @throws \Google\Service\Exception
|
---|
| 1122 | */
|
---|
| 1123 | public function setSecurityPolicy($project, $zone, $instance, InstancesSetSecurityPolicyRequest $postBody, $optParams = [])
|
---|
| 1124 | {
|
---|
| 1125 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1126 | $params = array_merge($params, $optParams);
|
---|
| 1127 | return $this->call('setSecurityPolicy', [$params], Operation::class);
|
---|
| 1128 | }
|
---|
| 1129 | /**
|
---|
| 1130 | * Sets the service account on the instance. For more information, read Changing
|
---|
| 1131 | * the service account and access scopes for an instance.
|
---|
| 1132 | * (instances.setServiceAccount)
|
---|
| 1133 | *
|
---|
| 1134 | * @param string $project Project ID for this request.
|
---|
| 1135 | * @param string $zone The name of the zone for this request.
|
---|
| 1136 | * @param string $instance Name of the instance resource to start.
|
---|
| 1137 | * @param InstancesSetServiceAccountRequest $postBody
|
---|
| 1138 | * @param array $optParams Optional parameters.
|
---|
| 1139 | *
|
---|
| 1140 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1141 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1142 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1143 | * example, consider a situation where you make an initial request and the
|
---|
| 1144 | * request times out. If you make the request again with the same request ID,
|
---|
| 1145 | * the server can check if original operation with the same request ID was
|
---|
| 1146 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1147 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1148 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1149 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1150 | * @return Operation
|
---|
| 1151 | * @throws \Google\Service\Exception
|
---|
| 1152 | */
|
---|
| 1153 | public function setServiceAccount($project, $zone, $instance, InstancesSetServiceAccountRequest $postBody, $optParams = [])
|
---|
| 1154 | {
|
---|
| 1155 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1156 | $params = array_merge($params, $optParams);
|
---|
| 1157 | return $this->call('setServiceAccount', [$params], Operation::class);
|
---|
| 1158 | }
|
---|
| 1159 | /**
|
---|
| 1160 | * Sets the Shielded Instance integrity policy for an instance. You can only use
|
---|
| 1161 | * this method on a running instance. This method supports PATCH semantics and
|
---|
| 1162 | * uses the JSON merge patch format and processing rules.
|
---|
| 1163 | * (instances.setShieldedInstanceIntegrityPolicy)
|
---|
| 1164 | *
|
---|
| 1165 | * @param string $project Project ID for this request.
|
---|
| 1166 | * @param string $zone The name of the zone for this request.
|
---|
| 1167 | * @param string $instance Name or id of the instance scoping this request.
|
---|
| 1168 | * @param ShieldedInstanceIntegrityPolicy $postBody
|
---|
| 1169 | * @param array $optParams Optional parameters.
|
---|
| 1170 | *
|
---|
| 1171 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1172 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1173 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1174 | * example, consider a situation where you make an initial request and the
|
---|
| 1175 | * request times out. If you make the request again with the same request ID,
|
---|
| 1176 | * the server can check if original operation with the same request ID was
|
---|
| 1177 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1178 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1179 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1180 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1181 | * @return Operation
|
---|
| 1182 | * @throws \Google\Service\Exception
|
---|
| 1183 | */
|
---|
| 1184 | public function setShieldedInstanceIntegrityPolicy($project, $zone, $instance, ShieldedInstanceIntegrityPolicy $postBody, $optParams = [])
|
---|
| 1185 | {
|
---|
| 1186 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1187 | $params = array_merge($params, $optParams);
|
---|
| 1188 | return $this->call('setShieldedInstanceIntegrityPolicy', [$params], Operation::class);
|
---|
| 1189 | }
|
---|
| 1190 | /**
|
---|
| 1191 | * Sets network tags for the specified instance to the data included in the
|
---|
| 1192 | * request. (instances.setTags)
|
---|
| 1193 | *
|
---|
| 1194 | * @param string $project Project ID for this request.
|
---|
| 1195 | * @param string $zone The name of the zone for this request.
|
---|
| 1196 | * @param string $instance Name of the instance scoping this request.
|
---|
| 1197 | * @param Tags $postBody
|
---|
| 1198 | * @param array $optParams Optional parameters.
|
---|
| 1199 | *
|
---|
| 1200 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1201 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1202 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1203 | * example, consider a situation where you make an initial request and the
|
---|
| 1204 | * request times out. If you make the request again with the same request ID,
|
---|
| 1205 | * the server can check if original operation with the same request ID was
|
---|
| 1206 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1207 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1208 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1209 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1210 | * @return Operation
|
---|
| 1211 | * @throws \Google\Service\Exception
|
---|
| 1212 | */
|
---|
| 1213 | public function setTags($project, $zone, $instance, Tags $postBody, $optParams = [])
|
---|
| 1214 | {
|
---|
| 1215 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1216 | $params = array_merge($params, $optParams);
|
---|
| 1217 | return $this->call('setTags', [$params], Operation::class);
|
---|
| 1218 | }
|
---|
| 1219 | /**
|
---|
| 1220 | * Simulates a host maintenance event on a VM. For more information, see
|
---|
| 1221 | * Simulate a host maintenance event. (instances.simulateMaintenanceEvent)
|
---|
| 1222 | *
|
---|
| 1223 | * @param string $project Project ID for this request.
|
---|
| 1224 | * @param string $zone The name of the zone for this request.
|
---|
| 1225 | * @param string $instance Name of the instance scoping this request.
|
---|
| 1226 | * @param array $optParams Optional parameters.
|
---|
| 1227 | *
|
---|
| 1228 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1229 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1230 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1231 | * example, consider a situation where you make an initial request and the
|
---|
| 1232 | * request times out. If you make the request again with the same request ID,
|
---|
| 1233 | * the server can check if original operation with the same request ID was
|
---|
| 1234 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1235 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1236 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1237 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1238 | * @opt_param bool withExtendedNotifications Determines whether the customers
|
---|
| 1239 | * receive notifications before migration. Only applicable to SF vms.
|
---|
| 1240 | * @return Operation
|
---|
| 1241 | * @throws \Google\Service\Exception
|
---|
| 1242 | */
|
---|
| 1243 | public function simulateMaintenanceEvent($project, $zone, $instance, $optParams = [])
|
---|
| 1244 | {
|
---|
| 1245 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 1246 | $params = array_merge($params, $optParams);
|
---|
| 1247 | return $this->call('simulateMaintenanceEvent', [$params], Operation::class);
|
---|
| 1248 | }
|
---|
| 1249 | /**
|
---|
| 1250 | * Starts an instance that was stopped using the instances().stop method. For
|
---|
| 1251 | * more information, see Restart an instance. (instances.start)
|
---|
| 1252 | *
|
---|
| 1253 | * @param string $project Project ID for this request.
|
---|
| 1254 | * @param string $zone The name of the zone for this request.
|
---|
| 1255 | * @param string $instance Name of the instance resource to start.
|
---|
| 1256 | * @param array $optParams Optional parameters.
|
---|
| 1257 | *
|
---|
| 1258 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1259 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1260 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1261 | * example, consider a situation where you make an initial request and the
|
---|
| 1262 | * request times out. If you make the request again with the same request ID,
|
---|
| 1263 | * the server can check if original operation with the same request ID was
|
---|
| 1264 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1265 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1266 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1267 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1268 | * @return Operation
|
---|
| 1269 | * @throws \Google\Service\Exception
|
---|
| 1270 | */
|
---|
| 1271 | public function start($project, $zone, $instance, $optParams = [])
|
---|
| 1272 | {
|
---|
| 1273 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 1274 | $params = array_merge($params, $optParams);
|
---|
| 1275 | return $this->call('start', [$params], Operation::class);
|
---|
| 1276 | }
|
---|
| 1277 | /**
|
---|
| 1278 | * Starts an instance that was stopped using the instances().stop method. For
|
---|
| 1279 | * more information, see Restart an instance. (instances.startWithEncryptionKey)
|
---|
| 1280 | *
|
---|
| 1281 | * @param string $project Project ID for this request.
|
---|
| 1282 | * @param string $zone The name of the zone for this request.
|
---|
| 1283 | * @param string $instance Name of the instance resource to start.
|
---|
| 1284 | * @param InstancesStartWithEncryptionKeyRequest $postBody
|
---|
| 1285 | * @param array $optParams Optional parameters.
|
---|
| 1286 | *
|
---|
| 1287 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1288 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1289 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1290 | * example, consider a situation where you make an initial request and the
|
---|
| 1291 | * request times out. If you make the request again with the same request ID,
|
---|
| 1292 | * the server can check if original operation with the same request ID was
|
---|
| 1293 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1294 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1295 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1296 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1297 | * @return Operation
|
---|
| 1298 | * @throws \Google\Service\Exception
|
---|
| 1299 | */
|
---|
| 1300 | public function startWithEncryptionKey($project, $zone, $instance, InstancesStartWithEncryptionKeyRequest $postBody, $optParams = [])
|
---|
| 1301 | {
|
---|
| 1302 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1303 | $params = array_merge($params, $optParams);
|
---|
| 1304 | return $this->call('startWithEncryptionKey', [$params], Operation::class);
|
---|
| 1305 | }
|
---|
| 1306 | /**
|
---|
| 1307 | * Stops a running instance, shutting it down cleanly, and allows you to restart
|
---|
| 1308 | * the instance at a later time. Stopped instances do not incur VM usage charges
|
---|
| 1309 | * while they are stopped. However, resources that the VM is using, such as
|
---|
| 1310 | * persistent disks and static IP addresses, will continue to be charged until
|
---|
| 1311 | * they are deleted. For more information, see Stopping an instance.
|
---|
| 1312 | * (instances.stop)
|
---|
| 1313 | *
|
---|
| 1314 | * @param string $project Project ID for this request.
|
---|
| 1315 | * @param string $zone The name of the zone for this request.
|
---|
| 1316 | * @param string $instance Name of the instance resource to stop.
|
---|
| 1317 | * @param array $optParams Optional parameters.
|
---|
| 1318 | *
|
---|
| 1319 | * @opt_param bool discardLocalSsd This property is required if the instance has
|
---|
| 1320 | * any attached Local SSD disks. If false, Local SSD data will be preserved when
|
---|
| 1321 | * the instance is suspended. If true, the contents of any attached Local SSD
|
---|
| 1322 | * disks will be discarded.
|
---|
| 1323 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1324 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1325 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1326 | * example, consider a situation where you make an initial request and the
|
---|
| 1327 | * request times out. If you make the request again with the same request ID,
|
---|
| 1328 | * the server can check if original operation with the same request ID was
|
---|
| 1329 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1330 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1331 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1332 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1333 | * @return Operation
|
---|
| 1334 | * @throws \Google\Service\Exception
|
---|
| 1335 | */
|
---|
| 1336 | public function stop($project, $zone, $instance, $optParams = [])
|
---|
| 1337 | {
|
---|
| 1338 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 1339 | $params = array_merge($params, $optParams);
|
---|
| 1340 | return $this->call('stop', [$params], Operation::class);
|
---|
| 1341 | }
|
---|
| 1342 | /**
|
---|
| 1343 | * This method suspends a running instance, saving its state to persistent
|
---|
| 1344 | * storage, and allows you to resume the instance at a later time. Suspended
|
---|
| 1345 | * instances have no compute costs (cores or RAM), and incur only storage
|
---|
| 1346 | * charges for the saved VM memory and localSSD data. Any charged resources the
|
---|
| 1347 | * virtual machine was using, such as persistent disks and static IP addresses,
|
---|
| 1348 | * will continue to be charged while the instance is suspended. For more
|
---|
| 1349 | * information, see Suspending and resuming an instance. (instances.suspend)
|
---|
| 1350 | *
|
---|
| 1351 | * @param string $project Project ID for this request.
|
---|
| 1352 | * @param string $zone The name of the zone for this request.
|
---|
| 1353 | * @param string $instance Name of the instance resource to suspend.
|
---|
| 1354 | * @param array $optParams Optional parameters.
|
---|
| 1355 | *
|
---|
| 1356 | * @opt_param bool discardLocalSsd This property is required if the instance has
|
---|
| 1357 | * any attached Local SSD disks. If false, Local SSD data will be preserved when
|
---|
| 1358 | * the instance is suspended. If true, the contents of any attached Local SSD
|
---|
| 1359 | * disks will be discarded.
|
---|
| 1360 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1361 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1362 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1363 | * example, consider a situation where you make an initial request and the
|
---|
| 1364 | * request times out. If you make the request again with the same request ID,
|
---|
| 1365 | * the server can check if original operation with the same request ID was
|
---|
| 1366 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1367 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1368 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1369 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1370 | * @return Operation
|
---|
| 1371 | * @throws \Google\Service\Exception
|
---|
| 1372 | */
|
---|
| 1373 | public function suspend($project, $zone, $instance, $optParams = [])
|
---|
| 1374 | {
|
---|
| 1375 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance];
|
---|
| 1376 | $params = array_merge($params, $optParams);
|
---|
| 1377 | return $this->call('suspend', [$params], Operation::class);
|
---|
| 1378 | }
|
---|
| 1379 | /**
|
---|
| 1380 | * Returns permissions that a caller has on the specified resource.
|
---|
| 1381 | * (instances.testIamPermissions)
|
---|
| 1382 | *
|
---|
| 1383 | * @param string $project Project ID for this request.
|
---|
| 1384 | * @param string $zone The name of the zone for this request.
|
---|
| 1385 | * @param string $resource Name or id of the resource for this request.
|
---|
| 1386 | * @param TestPermissionsRequest $postBody
|
---|
| 1387 | * @param array $optParams Optional parameters.
|
---|
| 1388 | * @return TestPermissionsResponse
|
---|
| 1389 | * @throws \Google\Service\Exception
|
---|
| 1390 | */
|
---|
| 1391 | public function testIamPermissions($project, $zone, $resource, TestPermissionsRequest $postBody, $optParams = [])
|
---|
| 1392 | {
|
---|
| 1393 | $params = ['project' => $project, 'zone' => $zone, 'resource' => $resource, 'postBody' => $postBody];
|
---|
| 1394 | $params = array_merge($params, $optParams);
|
---|
| 1395 | return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
|
---|
| 1396 | }
|
---|
| 1397 | /**
|
---|
| 1398 | * Updates an instance only if the necessary resources are available. This
|
---|
| 1399 | * method can update only a specific set of instance properties. See Updating a
|
---|
| 1400 | * running instance for a list of updatable instance properties.
|
---|
| 1401 | * (instances.update)
|
---|
| 1402 | *
|
---|
| 1403 | * @param string $project Project ID for this request.
|
---|
| 1404 | * @param string $zone The name of the zone for this request.
|
---|
| 1405 | * @param string $instance Name of the instance resource to update.
|
---|
| 1406 | * @param Instance $postBody
|
---|
| 1407 | * @param array $optParams Optional parameters.
|
---|
| 1408 | *
|
---|
| 1409 | * @opt_param string minimalAction Specifies the action to take when updating an
|
---|
| 1410 | * instance even if the updated properties do not require it. If not specified,
|
---|
| 1411 | * then Compute Engine acts based on the minimum action that the updated
|
---|
| 1412 | * properties require.
|
---|
| 1413 | * @opt_param string mostDisruptiveAllowedAction Specifies the most disruptive
|
---|
| 1414 | * action that can be taken on the instance as part of the update. Compute
|
---|
| 1415 | * Engine returns an error if the instance properties require a more disruptive
|
---|
| 1416 | * action as part of the instance update. Valid options from lowest to highest
|
---|
| 1417 | * are NO_EFFECT, REFRESH, and RESTART.
|
---|
| 1418 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1419 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1420 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1421 | * example, consider a situation where you make an initial request and the
|
---|
| 1422 | * request times out. If you make the request again with the same request ID,
|
---|
| 1423 | * the server can check if original operation with the same request ID was
|
---|
| 1424 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1425 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1426 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1427 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1428 | * @return Operation
|
---|
| 1429 | * @throws \Google\Service\Exception
|
---|
| 1430 | */
|
---|
| 1431 | public function update($project, $zone, $instance, Instance $postBody, $optParams = [])
|
---|
| 1432 | {
|
---|
| 1433 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1434 | $params = array_merge($params, $optParams);
|
---|
| 1435 | return $this->call('update', [$params], Operation::class);
|
---|
| 1436 | }
|
---|
| 1437 | /**
|
---|
| 1438 | * Updates the specified access config from an instance's network interface with
|
---|
| 1439 | * the data included in the request. This method supports PATCH semantics and
|
---|
| 1440 | * uses the JSON merge patch format and processing rules.
|
---|
| 1441 | * (instances.updateAccessConfig)
|
---|
| 1442 | *
|
---|
| 1443 | * @param string $project Project ID for this request.
|
---|
| 1444 | * @param string $zone The name of the zone for this request.
|
---|
| 1445 | * @param string $instance The instance name for this request.
|
---|
| 1446 | * @param string $networkInterface The name of the network interface where the
|
---|
| 1447 | * access config is attached.
|
---|
| 1448 | * @param AccessConfig $postBody
|
---|
| 1449 | * @param array $optParams Optional parameters.
|
---|
| 1450 | *
|
---|
| 1451 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1452 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1453 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1454 | * example, consider a situation where you make an initial request and the
|
---|
| 1455 | * request times out. If you make the request again with the same request ID,
|
---|
| 1456 | * the server can check if original operation with the same request ID was
|
---|
| 1457 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1458 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1459 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1460 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1461 | * @return Operation
|
---|
| 1462 | * @throws \Google\Service\Exception
|
---|
| 1463 | */
|
---|
| 1464 | public function updateAccessConfig($project, $zone, $instance, $networkInterface, AccessConfig $postBody, $optParams = [])
|
---|
| 1465 | {
|
---|
| 1466 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'networkInterface' => $networkInterface, 'postBody' => $postBody];
|
---|
| 1467 | $params = array_merge($params, $optParams);
|
---|
| 1468 | return $this->call('updateAccessConfig', [$params], Operation::class);
|
---|
| 1469 | }
|
---|
| 1470 | /**
|
---|
| 1471 | * Updates the Display config for a VM instance. You can only use this method on
|
---|
| 1472 | * a stopped VM instance. This method supports PATCH semantics and uses the JSON
|
---|
| 1473 | * merge patch format and processing rules. (instances.updateDisplayDevice)
|
---|
| 1474 | *
|
---|
| 1475 | * @param string $project Project ID for this request.
|
---|
| 1476 | * @param string $zone The name of the zone for this request.
|
---|
| 1477 | * @param string $instance Name of the instance scoping this request.
|
---|
| 1478 | * @param DisplayDevice $postBody
|
---|
| 1479 | * @param array $optParams Optional parameters.
|
---|
| 1480 | *
|
---|
| 1481 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1482 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1483 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1484 | * example, consider a situation where you make an initial request and the
|
---|
| 1485 | * request times out. If you make the request again with the same request ID,
|
---|
| 1486 | * the server can check if original operation with the same request ID was
|
---|
| 1487 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1488 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1489 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1490 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1491 | * @return Operation
|
---|
| 1492 | * @throws \Google\Service\Exception
|
---|
| 1493 | */
|
---|
| 1494 | public function updateDisplayDevice($project, $zone, $instance, DisplayDevice $postBody, $optParams = [])
|
---|
| 1495 | {
|
---|
| 1496 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1497 | $params = array_merge($params, $optParams);
|
---|
| 1498 | return $this->call('updateDisplayDevice', [$params], Operation::class);
|
---|
| 1499 | }
|
---|
| 1500 | /**
|
---|
| 1501 | * Updates an instance's network interface. This method can only update an
|
---|
| 1502 | * interface's alias IP range and attached network. See Modifying alias IP
|
---|
| 1503 | * ranges for an existing instance for instructions on changing alias IP ranges.
|
---|
| 1504 | * See Migrating a VM between networks for instructions on migrating an
|
---|
| 1505 | * interface. This method follows PATCH semantics.
|
---|
| 1506 | * (instances.updateNetworkInterface)
|
---|
| 1507 | *
|
---|
| 1508 | * @param string $project Project ID for this request.
|
---|
| 1509 | * @param string $zone The name of the zone for this request.
|
---|
| 1510 | * @param string $instance The instance name for this request.
|
---|
| 1511 | * @param string $networkInterface The name of the network interface to update.
|
---|
| 1512 | * @param NetworkInterface $postBody
|
---|
| 1513 | * @param array $optParams Optional parameters.
|
---|
| 1514 | *
|
---|
| 1515 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1516 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1517 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1518 | * example, consider a situation where you make an initial request and the
|
---|
| 1519 | * request times out. If you make the request again with the same request ID,
|
---|
| 1520 | * the server can check if original operation with the same request ID was
|
---|
| 1521 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1522 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1523 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1524 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1525 | * @return Operation
|
---|
| 1526 | * @throws \Google\Service\Exception
|
---|
| 1527 | */
|
---|
| 1528 | public function updateNetworkInterface($project, $zone, $instance, $networkInterface, NetworkInterface $postBody, $optParams = [])
|
---|
| 1529 | {
|
---|
| 1530 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'networkInterface' => $networkInterface, 'postBody' => $postBody];
|
---|
| 1531 | $params = array_merge($params, $optParams);
|
---|
| 1532 | return $this->call('updateNetworkInterface', [$params], Operation::class);
|
---|
| 1533 | }
|
---|
| 1534 | /**
|
---|
| 1535 | * Updates the Shielded Instance config for an instance. You can only use this
|
---|
| 1536 | * method on a stopped instance. This method supports PATCH semantics and uses
|
---|
| 1537 | * the JSON merge patch format and processing rules.
|
---|
| 1538 | * (instances.updateShieldedInstanceConfig)
|
---|
| 1539 | *
|
---|
| 1540 | * @param string $project Project ID for this request.
|
---|
| 1541 | * @param string $zone The name of the zone for this request.
|
---|
| 1542 | * @param string $instance Name or id of the instance scoping this request.
|
---|
| 1543 | * @param ShieldedInstanceConfig $postBody
|
---|
| 1544 | * @param array $optParams Optional parameters.
|
---|
| 1545 | *
|
---|
| 1546 | * @opt_param string requestId An optional request ID to identify requests.
|
---|
| 1547 | * Specify a unique request ID so that if you must retry your request, the
|
---|
| 1548 | * server will know to ignore the request if it has already been completed. For
|
---|
| 1549 | * example, consider a situation where you make an initial request and the
|
---|
| 1550 | * request times out. If you make the request again with the same request ID,
|
---|
| 1551 | * the server can check if original operation with the same request ID was
|
---|
| 1552 | * received, and if so, will ignore the second request. This prevents clients
|
---|
| 1553 | * from accidentally creating duplicate commitments. The request ID must be a
|
---|
| 1554 | * valid UUID with the exception that zero UUID is not supported (
|
---|
| 1555 | * 00000000-0000-0000-0000-000000000000).
|
---|
| 1556 | * @return Operation
|
---|
| 1557 | * @throws \Google\Service\Exception
|
---|
| 1558 | */
|
---|
| 1559 | public function updateShieldedInstanceConfig($project, $zone, $instance, ShieldedInstanceConfig $postBody, $optParams = [])
|
---|
| 1560 | {
|
---|
| 1561 | $params = ['project' => $project, 'zone' => $zone, 'instance' => $instance, 'postBody' => $postBody];
|
---|
| 1562 | $params = array_merge($params, $optParams);
|
---|
| 1563 | return $this->call('updateShieldedInstanceConfig', [$params], Operation::class);
|
---|
| 1564 | }
|
---|
| 1565 | }
|
---|
| 1566 |
|
---|
| 1567 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 1568 | class_alias(Instances::class, 'Google_Service_Compute_Resource_Instances');
|
---|