[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\Container\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Container\CompleteNodePoolUpgradeRequest;
|
---|
| 21 | use Google\Service\Container\ContainerEmpty;
|
---|
| 22 | use Google\Service\Container\CreateNodePoolRequest;
|
---|
| 23 | use Google\Service\Container\ListNodePoolsResponse;
|
---|
| 24 | use Google\Service\Container\NodePool;
|
---|
| 25 | use Google\Service\Container\Operation;
|
---|
| 26 | use Google\Service\Container\RollbackNodePoolUpgradeRequest;
|
---|
| 27 | use Google\Service\Container\SetNodePoolAutoscalingRequest;
|
---|
| 28 | use Google\Service\Container\SetNodePoolManagementRequest;
|
---|
| 29 | use Google\Service\Container\SetNodePoolSizeRequest;
|
---|
| 30 | use Google\Service\Container\UpdateNodePoolRequest;
|
---|
| 31 |
|
---|
| 32 | /**
|
---|
| 33 | * The "nodePools" collection of methods.
|
---|
| 34 | * Typical usage is:
|
---|
| 35 | * <code>
|
---|
| 36 | * $containerService = new Google\Service\Container(...);
|
---|
| 37 | * $nodePools = $containerService->projects_locations_clusters_nodePools;
|
---|
| 38 | * </code>
|
---|
| 39 | */
|
---|
| 40 | class ProjectsLocationsClustersNodePools extends \Google\Service\Resource
|
---|
| 41 | {
|
---|
| 42 | /**
|
---|
| 43 | * CompleteNodePoolUpgrade will signal an on-going node pool upgrade to
|
---|
| 44 | * complete. (nodePools.completeUpgrade)
|
---|
| 45 | *
|
---|
| 46 | * @param string $name The name (project, location, cluster, node pool id) of
|
---|
| 47 | * the node pool to complete upgrade. Specified in the format
|
---|
| 48 | * `projects/locations/clusters/nodePools`.
|
---|
| 49 | * @param CompleteNodePoolUpgradeRequest $postBody
|
---|
| 50 | * @param array $optParams Optional parameters.
|
---|
| 51 | * @return ContainerEmpty
|
---|
| 52 | * @throws \Google\Service\Exception
|
---|
| 53 | */
|
---|
| 54 | public function completeUpgrade($name, CompleteNodePoolUpgradeRequest $postBody, $optParams = [])
|
---|
| 55 | {
|
---|
| 56 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 57 | $params = array_merge($params, $optParams);
|
---|
| 58 | return $this->call('completeUpgrade', [$params], ContainerEmpty::class);
|
---|
| 59 | }
|
---|
| 60 | /**
|
---|
| 61 | * Creates a node pool for a cluster. (nodePools.create)
|
---|
| 62 | *
|
---|
| 63 | * @param string $parent The parent (project, location, cluster name) where the
|
---|
| 64 | * node pool will be created. Specified in the format
|
---|
| 65 | * `projects/locations/clusters`.
|
---|
| 66 | * @param CreateNodePoolRequest $postBody
|
---|
| 67 | * @param array $optParams Optional parameters.
|
---|
| 68 | * @return Operation
|
---|
| 69 | * @throws \Google\Service\Exception
|
---|
| 70 | */
|
---|
| 71 | public function create($parent, CreateNodePoolRequest $postBody, $optParams = [])
|
---|
| 72 | {
|
---|
| 73 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 74 | $params = array_merge($params, $optParams);
|
---|
| 75 | return $this->call('create', [$params], Operation::class);
|
---|
| 76 | }
|
---|
| 77 | /**
|
---|
| 78 | * Deletes a node pool from a cluster. (nodePools.delete)
|
---|
| 79 | *
|
---|
| 80 | * @param string $name The name (project, location, cluster, node pool id) of
|
---|
| 81 | * the node pool to delete. Specified in the format
|
---|
| 82 | * `projects/locations/clusters/nodePools`.
|
---|
| 83 | * @param array $optParams Optional parameters.
|
---|
| 84 | *
|
---|
| 85 | * @opt_param string clusterId Deprecated. The name of the cluster. This field
|
---|
| 86 | * has been deprecated and replaced by the name field.
|
---|
| 87 | * @opt_param string nodePoolId Deprecated. The name of the node pool to delete.
|
---|
| 88 | * This field has been deprecated and replaced by the name field.
|
---|
| 89 | * @opt_param string projectId Deprecated. The Google Developers Console
|
---|
| 90 | * [project ID or project number](https://cloud.google.com/resource-
|
---|
| 91 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
| 92 | * replaced by the name field.
|
---|
| 93 | * @opt_param string zone Deprecated. The name of the Google Compute Engine
|
---|
| 94 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
| 95 | * cluster resides. This field has been deprecated and replaced by the name
|
---|
| 96 | * field.
|
---|
| 97 | * @return Operation
|
---|
| 98 | * @throws \Google\Service\Exception
|
---|
| 99 | */
|
---|
| 100 | public function delete($name, $optParams = [])
|
---|
| 101 | {
|
---|
| 102 | $params = ['name' => $name];
|
---|
| 103 | $params = array_merge($params, $optParams);
|
---|
| 104 | return $this->call('delete', [$params], Operation::class);
|
---|
| 105 | }
|
---|
| 106 | /**
|
---|
| 107 | * Retrieves the requested node pool. (nodePools.get)
|
---|
| 108 | *
|
---|
| 109 | * @param string $name The name (project, location, cluster, node pool id) of
|
---|
| 110 | * the node pool to get. Specified in the format
|
---|
| 111 | * `projects/locations/clusters/nodePools`.
|
---|
| 112 | * @param array $optParams Optional parameters.
|
---|
| 113 | *
|
---|
| 114 | * @opt_param string clusterId Deprecated. The name of the cluster. This field
|
---|
| 115 | * has been deprecated and replaced by the name field.
|
---|
| 116 | * @opt_param string nodePoolId Deprecated. The name of the node pool. This
|
---|
| 117 | * field has been deprecated and replaced by the name field.
|
---|
| 118 | * @opt_param string projectId Deprecated. The Google Developers Console
|
---|
| 119 | * [project ID or project number](https://cloud.google.com/resource-
|
---|
| 120 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
| 121 | * replaced by the name field.
|
---|
| 122 | * @opt_param string zone Deprecated. The name of the Google Compute Engine
|
---|
| 123 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
| 124 | * cluster resides. This field has been deprecated and replaced by the name
|
---|
| 125 | * field.
|
---|
| 126 | * @return NodePool
|
---|
| 127 | * @throws \Google\Service\Exception
|
---|
| 128 | */
|
---|
| 129 | public function get($name, $optParams = [])
|
---|
| 130 | {
|
---|
| 131 | $params = ['name' => $name];
|
---|
| 132 | $params = array_merge($params, $optParams);
|
---|
| 133 | return $this->call('get', [$params], NodePool::class);
|
---|
| 134 | }
|
---|
| 135 | /**
|
---|
| 136 | * Lists the node pools for a cluster.
|
---|
| 137 | * (nodePools.listProjectsLocationsClustersNodePools)
|
---|
| 138 | *
|
---|
| 139 | * @param string $parent The parent (project, location, cluster name) where the
|
---|
| 140 | * node pools will be listed. Specified in the format
|
---|
| 141 | * `projects/locations/clusters`.
|
---|
| 142 | * @param array $optParams Optional parameters.
|
---|
| 143 | *
|
---|
| 144 | * @opt_param string clusterId Deprecated. The name of the cluster. This field
|
---|
| 145 | * has been deprecated and replaced by the parent field.
|
---|
| 146 | * @opt_param string projectId Deprecated. The Google Developers Console
|
---|
| 147 | * [project ID or project number](https://cloud.google.com/resource-
|
---|
| 148 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
| 149 | * replaced by the parent field.
|
---|
| 150 | * @opt_param string zone Deprecated. The name of the Google Compute Engine
|
---|
| 151 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
| 152 | * cluster resides. This field has been deprecated and replaced by the parent
|
---|
| 153 | * field.
|
---|
| 154 | * @return ListNodePoolsResponse
|
---|
| 155 | * @throws \Google\Service\Exception
|
---|
| 156 | */
|
---|
| 157 | public function listProjectsLocationsClustersNodePools($parent, $optParams = [])
|
---|
| 158 | {
|
---|
| 159 | $params = ['parent' => $parent];
|
---|
| 160 | $params = array_merge($params, $optParams);
|
---|
| 161 | return $this->call('list', [$params], ListNodePoolsResponse::class);
|
---|
| 162 | }
|
---|
| 163 | /**
|
---|
| 164 | * Rolls back a previously Aborted or Failed NodePool upgrade. This makes no
|
---|
| 165 | * changes if the last upgrade successfully completed. (nodePools.rollback)
|
---|
| 166 | *
|
---|
| 167 | * @param string $name The name (project, location, cluster, node pool id) of
|
---|
| 168 | * the node poll to rollback upgrade. Specified in the format
|
---|
| 169 | * `projects/locations/clusters/nodePools`.
|
---|
| 170 | * @param RollbackNodePoolUpgradeRequest $postBody
|
---|
| 171 | * @param array $optParams Optional parameters.
|
---|
| 172 | * @return Operation
|
---|
| 173 | * @throws \Google\Service\Exception
|
---|
| 174 | */
|
---|
| 175 | public function rollback($name, RollbackNodePoolUpgradeRequest $postBody, $optParams = [])
|
---|
| 176 | {
|
---|
| 177 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 178 | $params = array_merge($params, $optParams);
|
---|
| 179 | return $this->call('rollback', [$params], Operation::class);
|
---|
| 180 | }
|
---|
| 181 | /**
|
---|
| 182 | * Sets the autoscaling settings for the specified node pool.
|
---|
| 183 | * (nodePools.setAutoscaling)
|
---|
| 184 | *
|
---|
| 185 | * @param string $name The name (project, location, cluster, node pool) of the
|
---|
| 186 | * node pool to set autoscaler settings. Specified in the format
|
---|
| 187 | * `projects/locations/clusters/nodePools`.
|
---|
| 188 | * @param SetNodePoolAutoscalingRequest $postBody
|
---|
| 189 | * @param array $optParams Optional parameters.
|
---|
| 190 | * @return Operation
|
---|
| 191 | * @throws \Google\Service\Exception
|
---|
| 192 | */
|
---|
| 193 | public function setAutoscaling($name, SetNodePoolAutoscalingRequest $postBody, $optParams = [])
|
---|
| 194 | {
|
---|
| 195 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 196 | $params = array_merge($params, $optParams);
|
---|
| 197 | return $this->call('setAutoscaling', [$params], Operation::class);
|
---|
| 198 | }
|
---|
| 199 | /**
|
---|
| 200 | * Sets the NodeManagement options for a node pool. (nodePools.setManagement)
|
---|
| 201 | *
|
---|
| 202 | * @param string $name The name (project, location, cluster, node pool id) of
|
---|
| 203 | * the node pool to set management properties. Specified in the format
|
---|
| 204 | * `projects/locations/clusters/nodePools`.
|
---|
| 205 | * @param SetNodePoolManagementRequest $postBody
|
---|
| 206 | * @param array $optParams Optional parameters.
|
---|
| 207 | * @return Operation
|
---|
| 208 | * @throws \Google\Service\Exception
|
---|
| 209 | */
|
---|
| 210 | public function setManagement($name, SetNodePoolManagementRequest $postBody, $optParams = [])
|
---|
| 211 | {
|
---|
| 212 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 213 | $params = array_merge($params, $optParams);
|
---|
| 214 | return $this->call('setManagement', [$params], Operation::class);
|
---|
| 215 | }
|
---|
| 216 | /**
|
---|
| 217 | * Sets the size for a specific node pool. The new size will be used for all
|
---|
| 218 | * replicas, including future replicas created by modifying NodePool.locations.
|
---|
| 219 | * (nodePools.setSize)
|
---|
| 220 | *
|
---|
| 221 | * @param string $name The name (project, location, cluster, node pool id) of
|
---|
| 222 | * the node pool to set size. Specified in the format
|
---|
| 223 | * `projects/locations/clusters/nodePools`.
|
---|
| 224 | * @param SetNodePoolSizeRequest $postBody
|
---|
| 225 | * @param array $optParams Optional parameters.
|
---|
| 226 | * @return Operation
|
---|
| 227 | * @throws \Google\Service\Exception
|
---|
| 228 | */
|
---|
| 229 | public function setSize($name, SetNodePoolSizeRequest $postBody, $optParams = [])
|
---|
| 230 | {
|
---|
| 231 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 232 | $params = array_merge($params, $optParams);
|
---|
| 233 | return $this->call('setSize', [$params], Operation::class);
|
---|
| 234 | }
|
---|
| 235 | /**
|
---|
| 236 | * Updates the version and/or image type for the specified node pool.
|
---|
| 237 | * (nodePools.update)
|
---|
| 238 | *
|
---|
| 239 | * @param string $name The name (project, location, cluster, node pool) of the
|
---|
| 240 | * node pool to update. Specified in the format
|
---|
| 241 | * `projects/locations/clusters/nodePools`.
|
---|
| 242 | * @param UpdateNodePoolRequest $postBody
|
---|
| 243 | * @param array $optParams Optional parameters.
|
---|
| 244 | * @return Operation
|
---|
| 245 | * @throws \Google\Service\Exception
|
---|
| 246 | */
|
---|
| 247 | public function update($name, UpdateNodePoolRequest $postBody, $optParams = [])
|
---|
| 248 | {
|
---|
| 249 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 250 | $params = array_merge($params, $optParams);
|
---|
| 251 | return $this->call('update', [$params], Operation::class);
|
---|
| 252 | }
|
---|
| 253 | }
|
---|
| 254 |
|
---|
| 255 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 256 | class_alias(ProjectsLocationsClustersNodePools::class, 'Google_Service_Container_Resource_ProjectsLocationsClustersNodePools');
|
---|