[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\ListVersionsResponse;
|
---|
| 21 | use Google\Service\Appengine\Operation;
|
---|
| 22 | use Google\Service\Appengine\Version;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "versions" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $appengineService = new Google\Service\Appengine(...);
|
---|
| 29 | * $versions = $appengineService->apps_services_versions;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class AppsServicesVersions extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Deploys code and resource files to a new version. (versions.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $appsId Part of `parent`. Name of the parent resource to create
|
---|
| 38 | * this version under. Example: apps/myapp/services/default.
|
---|
| 39 | * @param string $servicesId Part of `parent`. See documentation of `appsId`.
|
---|
| 40 | * @param Version $postBody
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | * @return Operation
|
---|
| 43 | * @throws \Google\Service\Exception
|
---|
| 44 | */
|
---|
| 45 | public function create($appsId, $servicesId, Version $postBody, $optParams = [])
|
---|
| 46 | {
|
---|
| 47 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'postBody' => $postBody];
|
---|
| 48 | $params = array_merge($params, $optParams);
|
---|
| 49 | return $this->call('create', [$params], Operation::class);
|
---|
| 50 | }
|
---|
| 51 | /**
|
---|
| 52 | * Deletes an existing Version resource. (versions.delete)
|
---|
| 53 | *
|
---|
| 54 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
| 55 | * Example: apps/myapp/services/default/versions/v1.
|
---|
| 56 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
| 57 | * @param string $versionsId Part of `name`. See documentation of `appsId`.
|
---|
| 58 | * @param array $optParams Optional parameters.
|
---|
| 59 | * @return Operation
|
---|
| 60 | * @throws \Google\Service\Exception
|
---|
| 61 | */
|
---|
| 62 | public function delete($appsId, $servicesId, $versionsId, $optParams = [])
|
---|
| 63 | {
|
---|
| 64 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId];
|
---|
| 65 | $params = array_merge($params, $optParams);
|
---|
| 66 | return $this->call('delete', [$params], Operation::class);
|
---|
| 67 | }
|
---|
| 68 | /**
|
---|
| 69 | * Gets the specified Version resource. By default, only a BASIC_VIEW will be
|
---|
| 70 | * returned. Specify the FULL_VIEW parameter to get the full resource.
|
---|
| 71 | * (versions.get)
|
---|
| 72 | *
|
---|
| 73 | * @param string $appsId Part of `name`. Name of the resource requested.
|
---|
| 74 | * Example: apps/myapp/services/default/versions/v1.
|
---|
| 75 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
| 76 | * @param string $versionsId Part of `name`. See documentation of `appsId`.
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | *
|
---|
| 79 | * @opt_param string view Controls the set of fields returned in the Get
|
---|
| 80 | * response.
|
---|
| 81 | * @return Version
|
---|
| 82 | * @throws \Google\Service\Exception
|
---|
| 83 | */
|
---|
| 84 | public function get($appsId, $servicesId, $versionsId, $optParams = [])
|
---|
| 85 | {
|
---|
| 86 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId];
|
---|
| 87 | $params = array_merge($params, $optParams);
|
---|
| 88 | return $this->call('get', [$params], Version::class);
|
---|
| 89 | }
|
---|
| 90 | /**
|
---|
| 91 | * Lists the versions of a service. (versions.listAppsServicesVersions)
|
---|
| 92 | *
|
---|
| 93 | * @param string $appsId Part of `parent`. Name of the parent Service resource.
|
---|
| 94 | * Example: apps/myapp/services/default.
|
---|
| 95 | * @param string $servicesId Part of `parent`. See documentation of `appsId`.
|
---|
| 96 | * @param array $optParams Optional parameters.
|
---|
| 97 | *
|
---|
| 98 | * @opt_param int pageSize Maximum results to return per page.
|
---|
| 99 | * @opt_param string pageToken Continuation token for fetching the next page of
|
---|
| 100 | * results.
|
---|
| 101 | * @opt_param string view Controls the set of fields returned in the List
|
---|
| 102 | * response.
|
---|
| 103 | * @return ListVersionsResponse
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function listAppsServicesVersions($appsId, $servicesId, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('list', [$params], ListVersionsResponse::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Updates the specified Version resource. You can specify the following fields
|
---|
| 114 | * depending on the App Engine environment and type of scaling that the version
|
---|
| 115 | * resource uses:Standard environment instance_class
|
---|
| 116 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 117 | * vices.versions#Version.FIELDS.instance_class)automatic scaling in the
|
---|
| 118 | * standard environment: automatic_scaling.min_idle_instances
|
---|
| 119 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 120 | * vices.versions#Version.FIELDS.automatic_scaling)
|
---|
| 121 | * automatic_scaling.max_idle_instances
|
---|
| 122 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 123 | * vices.versions#Version.FIELDS.automatic_scaling)
|
---|
| 124 | * automaticScaling.standard_scheduler_settings.max_instances
|
---|
| 125 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
| 126 | * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
---|
| 127 | * automaticScaling.standard_scheduler_settings.min_instances
|
---|
| 128 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
| 129 | * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
---|
| 130 | * automaticScaling.standard_scheduler_settings.target_cpu_utilization
|
---|
| 131 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
| 132 | * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
|
---|
| 133 | * automaticScaling.standard_scheduler_settings.target_throughput_utilization
|
---|
| 134 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
| 135 | * api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)basic
|
---|
| 136 | * scaling or manual scaling in the standard environment: serving_status
|
---|
| 137 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
| 138 | * api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
|
---|
| 139 | * manual_scaling.instances (https://cloud.google.com/appengine/docs/admin-
|
---|
| 140 | * api/reference/rest/v1/apps.services.versions#manualscaling)Flexible
|
---|
| 141 | * environment serving_status (https://cloud.google.com/appengine/docs/admin-api
|
---|
| 142 | * /reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)autom
|
---|
| 143 | * atic scaling in the flexible environment:
|
---|
| 144 | * automatic_scaling.min_total_instances
|
---|
| 145 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 146 | * vices.versions#Version.FIELDS.automatic_scaling)
|
---|
| 147 | * automatic_scaling.max_total_instances
|
---|
| 148 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 149 | * vices.versions#Version.FIELDS.automatic_scaling)
|
---|
| 150 | * automatic_scaling.cool_down_period_sec
|
---|
| 151 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 152 | * vices.versions#Version.FIELDS.automatic_scaling)
|
---|
| 153 | * automatic_scaling.cpu_utilization.target_utilization
|
---|
| 154 | * (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.ser
|
---|
| 155 | * vices.versions#Version.FIELDS.automatic_scaling)manual scaling in the
|
---|
| 156 | * flexible environment: manual_scaling.instances
|
---|
| 157 | * (https://cloud.google.com/appengine/docs/admin-
|
---|
| 158 | * api/reference/rest/v1/apps.services.versions#manualscaling) (versions.patch)
|
---|
| 159 | *
|
---|
| 160 | * @param string $appsId Part of `name`. Name of the resource to update.
|
---|
| 161 | * Example: apps/myapp/services/default/versions/1.
|
---|
| 162 | * @param string $servicesId Part of `name`. See documentation of `appsId`.
|
---|
| 163 | * @param string $versionsId Part of `name`. See documentation of `appsId`.
|
---|
| 164 | * @param Version $postBody
|
---|
| 165 | * @param array $optParams Optional parameters.
|
---|
| 166 | *
|
---|
| 167 | * @opt_param string updateMask Standard field mask for the set of fields to be
|
---|
| 168 | * updated.
|
---|
| 169 | * @return Operation
|
---|
| 170 | * @throws \Google\Service\Exception
|
---|
| 171 | */
|
---|
| 172 | public function patch($appsId, $servicesId, $versionsId, Version $postBody, $optParams = [])
|
---|
| 173 | {
|
---|
| 174 | $params = ['appsId' => $appsId, 'servicesId' => $servicesId, 'versionsId' => $versionsId, 'postBody' => $postBody];
|
---|
| 175 | $params = array_merge($params, $optParams);
|
---|
| 176 | return $this->call('patch', [$params], Operation::class);
|
---|
| 177 | }
|
---|
| 178 | }
|
---|
| 179 |
|
---|
| 180 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 181 | class_alias(AppsServicesVersions::class, 'Google_Service_Appengine_Resource_AppsServicesVersions');
|
---|