[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\Appengine\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Appengine\DebugInstanceRequest;
|
---|
| 21 | use Google\Service\Appengine\Instance;
|
---|
| 22 | use Google\Service\Appengine\ListInstancesResponse;
|
---|
| 23 | use Google\Service\Appengine\Operation;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "instances" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $appengineService = new Google\Service\Appengine(...);
|
---|
| 30 | * $instances = $appengineService->apps_services_versions_instances;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class AppsServicesVersionsInstances extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Enables debugging on a VM instance. This allows you to use the SSH command to
|
---|
| 37 | * connect to the virtual machine where the instance lives. While in "debug
|
---|
| 38 | * mode", the instance continues to serve live traffic. You should delete the
|
---|
| 39 | * instance when you are done debugging and then allow the system to take over
|
---|
| 40 | * and determine if another instance should be started.Only applicable for
|
---|
| 41 | * instances in App Engine flexible environment. (instances.debug)
|
---|
| 42 | *
|
---|
| 43 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
| 44 | * Example: apps/myapp/services/default/versions/v1/instances/instance-1.
|
---|
| 45 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
| 46 | * @param string $versionsId Part of `name`. See documentation of `appsId`.
|
---|
| 47 | * @param string $instancesId Part of `name`. See documentation of `appsId`.
|
---|
| 48 | * @param DebugInstanceRequest $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return Operation
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function debug($appsId, $servicesId, $versionsId, $instancesId, DebugInstanceRequest $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId, 'instancesId' => $instancesId, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('debug', [$params], Operation::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Stops a running instance.The instance might be automatically recreated based
|
---|
| 61 | * on the scaling settings of the version. For more information, see "How
|
---|
| 62 | * Instances are Managed" (standard environment
|
---|
| 63 | * (https://cloud.google.com/appengine/docs/standard/python/how-instances-are-
|
---|
| 64 | * managed) | flexible environment
|
---|
| 65 | * (https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-
|
---|
| 66 | * managed)).To ensure that instances are not re-created and avoid getting
|
---|
| 67 | * billed, you can stop all instances within the target version by changing the
|
---|
| 68 | * serving status of the version to STOPPED with the
|
---|
| 69 | * apps.services.versions.patch (https://cloud.google.com/appengine/docs/admin-
|
---|
| 70 | * api/reference/rest/v1/apps.services.versions/patch) method.
|
---|
| 71 | * (instances.delete)
|
---|
| 72 | *
|
---|
| 73 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
| 74 | * Example: apps/myapp/services/default/versions/v1/instances/instance-1.
|
---|
| 75 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
| 76 | * @param string $versionsId Part of `name`. See documentation of `appsId`.
|
---|
| 77 | * @param string $instancesId Part of `name`. See documentation of `appsId`.
|
---|
| 78 | * @param array $optParams Optional parameters.
|
---|
| 79 | * @return Operation
|
---|
| 80 | * @throws \Google\Service\Exception
|
---|
| 81 | */
|
---|
| 82 | public function delete($appsId, $servicesId, $versionsId, $instancesId, $optParams = [])
|
---|
| 83 | {
|
---|
| 84 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId, 'instancesId' => $instancesId];
|
---|
| 85 | $params = array_merge($params, $optParams);
|
---|
| 86 | return $this->call('delete', [$params], Operation::class);
|
---|
| 87 | }
|
---|
| 88 | /**
|
---|
| 89 | * Gets instance information. (instances.get)
|
---|
| 90 | *
|
---|
| 91 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
| 92 | * Example: apps/myapp/services/default/versions/v1/instances/instance-1.
|
---|
| 93 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
| 94 | * @param string $versionsId Part of `name`. See documentation of `appsId`.
|
---|
| 95 | * @param string $instancesId Part of `name`. See documentation of `appsId`.
|
---|
| 96 | * @param array $optParams Optional parameters.
|
---|
| 97 | * @return Instance
|
---|
| 98 | * @throws \Google\Service\Exception
|
---|
| 99 | */
|
---|
| 100 | public function get($appsId, $servicesId, $versionsId, $instancesId, $optParams = [])
|
---|
| 101 | {
|
---|
| 102 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId, 'instancesId' => $instancesId];
|
---|
| 103 | $params = array_merge($params, $optParams);
|
---|
| 104 | return $this->call('get', [$params], Instance::class);
|
---|
| 105 | }
|
---|
| 106 | /**
|
---|
| 107 | * Lists the instances of a version.Tip: To aggregate details about instances
|
---|
| 108 | * over time, see the Stackdriver Monitoring API (https://cloud.google.com/monit
|
---|
| 109 | * oring/api/ref_v3/rest/v3/projects.timeSeries/list).
|
---|
| 110 | * (instances.listAppsServicesVersionsInstances)
|
---|
| 111 | *
|
---|
| 112 | * @param string $appsId Part of `parent`. Name of the parent Version resource.
|
---|
| 113 | * Example: apps/myapp/services/default/versions/v1.
|
---|
| 114 | * @param string $servicesId Part of `parent`. See documentation of `appsId`.
|
---|
| 115 | * @param string $versionsId Part of `parent`. See documentation of `appsId`.
|
---|
| 116 | * @param array $optParams Optional parameters.
|
---|
| 117 | *
|
---|
| 118 | * @opt_param int pageSize Maximum results to return per page.
|
---|
| 119 | * @opt_param string pageToken Continuation token for fetching the next page of
|
---|
| 120 | * results.
|
---|
| 121 | * @return ListInstancesResponse
|
---|
| 122 | * @throws \Google\Service\Exception
|
---|
| 123 | */
|
---|
| 124 | public function listAppsServicesVersionsInstances($appsId, $servicesId, $versionsId, $optParams = [])
|
---|
| 125 | {
|
---|
| 126 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId];
|
---|
| 127 | $params = array_merge($params, $optParams);
|
---|
| 128 | return $this->call('list', [$params], ListInstancesResponse::class);
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 |
|
---|
| 132 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 133 | class_alias(AppsServicesVersionsInstances::class, 'Google_Service_Appengine_Resource_AppsServicesVersionsInstances');
|
---|