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