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\CheckAutopilotCompatibilityResponse;
|
---|
21 | use Google\Service\Container\Cluster;
|
---|
22 | use Google\Service\Container\CompleteIPRotationRequest;
|
---|
23 | use Google\Service\Container\CreateClusterRequest;
|
---|
24 | use Google\Service\Container\GetJSONWebKeysResponse;
|
---|
25 | use Google\Service\Container\ListClustersResponse;
|
---|
26 | use Google\Service\Container\Operation;
|
---|
27 | use Google\Service\Container\SetAddonsConfigRequest;
|
---|
28 | use Google\Service\Container\SetLabelsRequest;
|
---|
29 | use Google\Service\Container\SetLegacyAbacRequest;
|
---|
30 | use Google\Service\Container\SetLocationsRequest;
|
---|
31 | use Google\Service\Container\SetLoggingServiceRequest;
|
---|
32 | use Google\Service\Container\SetMaintenancePolicyRequest;
|
---|
33 | use Google\Service\Container\SetMasterAuthRequest;
|
---|
34 | use Google\Service\Container\SetMonitoringServiceRequest;
|
---|
35 | use Google\Service\Container\SetNetworkPolicyRequest;
|
---|
36 | use Google\Service\Container\StartIPRotationRequest;
|
---|
37 | use Google\Service\Container\UpdateClusterRequest;
|
---|
38 | use Google\Service\Container\UpdateMasterRequest;
|
---|
39 |
|
---|
40 | /**
|
---|
41 | * The "clusters" collection of methods.
|
---|
42 | * Typical usage is:
|
---|
43 | * <code>
|
---|
44 | * $containerService = new Google\Service\Container(...);
|
---|
45 | * $clusters = $containerService->projects_locations_clusters;
|
---|
46 | * </code>
|
---|
47 | */
|
---|
48 | class ProjectsLocationsClusters extends \Google\Service\Resource
|
---|
49 | {
|
---|
50 | /**
|
---|
51 | * Checks the cluster compatibility with Autopilot mode, and returns a list of
|
---|
52 | * compatibility issues. (clusters.checkAutopilotCompatibility)
|
---|
53 | *
|
---|
54 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
55 | * retrieve. Specified in the format `projects/locations/clusters`.
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return CheckAutopilotCompatibilityResponse
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function checkAutopilotCompatibility($name, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['name' => $name];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('checkAutopilotCompatibility', [$params], CheckAutopilotCompatibilityResponse::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Completes master IP rotation. (clusters.completeIpRotation)
|
---|
68 | *
|
---|
69 | * @param string $name The name (project, location, cluster name) of the cluster
|
---|
70 | * to complete IP rotation. Specified in the format
|
---|
71 | * `projects/locations/clusters`.
|
---|
72 | * @param CompleteIPRotationRequest $postBody
|
---|
73 | * @param array $optParams Optional parameters.
|
---|
74 | * @return Operation
|
---|
75 | * @throws \Google\Service\Exception
|
---|
76 | */
|
---|
77 | public function completeIpRotation($name, CompleteIPRotationRequest $postBody, $optParams = [])
|
---|
78 | {
|
---|
79 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
80 | $params = array_merge($params, $optParams);
|
---|
81 | return $this->call('completeIpRotation', [$params], Operation::class);
|
---|
82 | }
|
---|
83 | /**
|
---|
84 | * Creates a cluster, consisting of the specified number and type of Google
|
---|
85 | * Compute Engine instances. By default, the cluster is created in the project's
|
---|
86 | * [default network](https://cloud.google.com/compute/docs/networks-and-
|
---|
87 | * firewalls#networks). One firewall is added for the cluster. After cluster
|
---|
88 | * creation, the Kubelet creates routes for each node to allow the containers on
|
---|
89 | * that node to communicate with all other instances in the cluster. Finally, an
|
---|
90 | * entry is added to the project's global metadata indicating which CIDR range
|
---|
91 | * the cluster is using. (clusters.create)
|
---|
92 | *
|
---|
93 | * @param string $parent The parent (project and location) where the cluster
|
---|
94 | * will be created. Specified in the format `projects/locations`.
|
---|
95 | * @param CreateClusterRequest $postBody
|
---|
96 | * @param array $optParams Optional parameters.
|
---|
97 | * @return Operation
|
---|
98 | * @throws \Google\Service\Exception
|
---|
99 | */
|
---|
100 | public function create($parent, CreateClusterRequest $postBody, $optParams = [])
|
---|
101 | {
|
---|
102 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
103 | $params = array_merge($params, $optParams);
|
---|
104 | return $this->call('create', [$params], Operation::class);
|
---|
105 | }
|
---|
106 | /**
|
---|
107 | * Deletes the cluster, including the Kubernetes endpoint and all worker nodes.
|
---|
108 | * Firewalls and routes that were configured during cluster creation are also
|
---|
109 | * deleted. Other Google Compute Engine resources that might be in use by the
|
---|
110 | * cluster, such as load balancer resources, are not deleted if they weren't
|
---|
111 | * present when the cluster was initially created. (clusters.delete)
|
---|
112 | *
|
---|
113 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
114 | * delete. Specified in the format `projects/locations/clusters`.
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | *
|
---|
117 | * @opt_param string clusterId Deprecated. The name of the cluster to delete.
|
---|
118 | * This field has been deprecated and replaced by the name field.
|
---|
119 | * @opt_param string projectId Deprecated. The Google Developers Console
|
---|
120 | * [project ID or project number](https://cloud.google.com/resource-
|
---|
121 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
122 | * replaced by the name field.
|
---|
123 | * @opt_param string zone Deprecated. The name of the Google Compute Engine
|
---|
124 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
125 | * cluster resides. This field has been deprecated and replaced by the name
|
---|
126 | * field.
|
---|
127 | * @return Operation
|
---|
128 | * @throws \Google\Service\Exception
|
---|
129 | */
|
---|
130 | public function delete($name, $optParams = [])
|
---|
131 | {
|
---|
132 | $params = ['name' => $name];
|
---|
133 | $params = array_merge($params, $optParams);
|
---|
134 | return $this->call('delete', [$params], Operation::class);
|
---|
135 | }
|
---|
136 | /**
|
---|
137 | * Gets the details of a specific cluster. (clusters.get)
|
---|
138 | *
|
---|
139 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
140 | * retrieve. Specified in the format `projects/locations/clusters`.
|
---|
141 | * @param array $optParams Optional parameters.
|
---|
142 | *
|
---|
143 | * @opt_param string clusterId Deprecated. The name of the cluster to retrieve.
|
---|
144 | * This field has been deprecated and replaced by the name field.
|
---|
145 | * @opt_param string projectId Deprecated. The Google Developers Console
|
---|
146 | * [project ID or project number](https://cloud.google.com/resource-
|
---|
147 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
148 | * replaced by the name field.
|
---|
149 | * @opt_param string zone Deprecated. The name of the Google Compute Engine
|
---|
150 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
151 | * cluster resides. This field has been deprecated and replaced by the name
|
---|
152 | * field.
|
---|
153 | * @return Cluster
|
---|
154 | * @throws \Google\Service\Exception
|
---|
155 | */
|
---|
156 | public function get($name, $optParams = [])
|
---|
157 | {
|
---|
158 | $params = ['name' => $name];
|
---|
159 | $params = array_merge($params, $optParams);
|
---|
160 | return $this->call('get', [$params], Cluster::class);
|
---|
161 | }
|
---|
162 | /**
|
---|
163 | * Gets the public component of the cluster signing keys in JSON Web Key format.
|
---|
164 | * (clusters.getJwks)
|
---|
165 | *
|
---|
166 | * @param string $parent The cluster (project, location, cluster name) to get
|
---|
167 | * keys for. Specified in the format `projects/locations/clusters`.
|
---|
168 | * @param array $optParams Optional parameters.
|
---|
169 | * @return GetJSONWebKeysResponse
|
---|
170 | * @throws \Google\Service\Exception
|
---|
171 | */
|
---|
172 | public function getJwks($parent, $optParams = [])
|
---|
173 | {
|
---|
174 | $params = ['parent' => $parent];
|
---|
175 | $params = array_merge($params, $optParams);
|
---|
176 | return $this->call('getJwks', [$params], GetJSONWebKeysResponse::class);
|
---|
177 | }
|
---|
178 | /**
|
---|
179 | * Lists all clusters owned by a project in either the specified zone or all
|
---|
180 | * zones. (clusters.listProjectsLocationsClusters)
|
---|
181 | *
|
---|
182 | * @param string $parent The parent (project and location) where the clusters
|
---|
183 | * will be listed. Specified in the format `projects/locations`. Location "-"
|
---|
184 | * matches all zones and all regions.
|
---|
185 | * @param array $optParams Optional parameters.
|
---|
186 | *
|
---|
187 | * @opt_param string projectId Deprecated. The Google Developers Console
|
---|
188 | * [project ID or project number](https://cloud.google.com/resource-
|
---|
189 | * manager/docs/creating-managing-projects). This field has been deprecated and
|
---|
190 | * replaced by the parent field.
|
---|
191 | * @opt_param string zone Deprecated. The name of the Google Compute Engine
|
---|
192 | * [zone](https://cloud.google.com/compute/docs/zones#available) in which the
|
---|
193 | * cluster resides, or "-" for all zones. This field has been deprecated and
|
---|
194 | * replaced by the parent field.
|
---|
195 | * @return ListClustersResponse
|
---|
196 | * @throws \Google\Service\Exception
|
---|
197 | */
|
---|
198 | public function listProjectsLocationsClusters($parent, $optParams = [])
|
---|
199 | {
|
---|
200 | $params = ['parent' => $parent];
|
---|
201 | $params = array_merge($params, $optParams);
|
---|
202 | return $this->call('list', [$params], ListClustersResponse::class);
|
---|
203 | }
|
---|
204 | /**
|
---|
205 | * Sets the addons for a specific cluster. (clusters.setAddons)
|
---|
206 | *
|
---|
207 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
208 | * set addons. Specified in the format `projects/locations/clusters`.
|
---|
209 | * @param SetAddonsConfigRequest $postBody
|
---|
210 | * @param array $optParams Optional parameters.
|
---|
211 | * @return Operation
|
---|
212 | * @throws \Google\Service\Exception
|
---|
213 | */
|
---|
214 | public function setAddons($name, SetAddonsConfigRequest $postBody, $optParams = [])
|
---|
215 | {
|
---|
216 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
217 | $params = array_merge($params, $optParams);
|
---|
218 | return $this->call('setAddons', [$params], Operation::class);
|
---|
219 | }
|
---|
220 | /**
|
---|
221 | * Enables or disables the ABAC authorization mechanism on a cluster.
|
---|
222 | * (clusters.setLegacyAbac)
|
---|
223 | *
|
---|
224 | * @param string $name The name (project, location, cluster name) of the cluster
|
---|
225 | * to set legacy abac. Specified in the format `projects/locations/clusters`.
|
---|
226 | * @param SetLegacyAbacRequest $postBody
|
---|
227 | * @param array $optParams Optional parameters.
|
---|
228 | * @return Operation
|
---|
229 | * @throws \Google\Service\Exception
|
---|
230 | */
|
---|
231 | public function setLegacyAbac($name, SetLegacyAbacRequest $postBody, $optParams = [])
|
---|
232 | {
|
---|
233 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
234 | $params = array_merge($params, $optParams);
|
---|
235 | return $this->call('setLegacyAbac', [$params], Operation::class);
|
---|
236 | }
|
---|
237 | /**
|
---|
238 | * Sets the locations for a specific cluster. Deprecated. Use
|
---|
239 | * [projects.locations.clusters.update](https://cloud.google.com/kubernetes-
|
---|
240 | * engine/docs/reference/rest/v1/projects.locations.clusters/update) instead.
|
---|
241 | * (clusters.setLocations)
|
---|
242 | *
|
---|
243 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
244 | * set locations. Specified in the format `projects/locations/clusters`.
|
---|
245 | * @param SetLocationsRequest $postBody
|
---|
246 | * @param array $optParams Optional parameters.
|
---|
247 | * @return Operation
|
---|
248 | * @throws \Google\Service\Exception
|
---|
249 | */
|
---|
250 | public function setLocations($name, SetLocationsRequest $postBody, $optParams = [])
|
---|
251 | {
|
---|
252 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
253 | $params = array_merge($params, $optParams);
|
---|
254 | return $this->call('setLocations', [$params], Operation::class);
|
---|
255 | }
|
---|
256 | /**
|
---|
257 | * Sets the logging service for a specific cluster. (clusters.setLogging)
|
---|
258 | *
|
---|
259 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
260 | * set logging. Specified in the format `projects/locations/clusters`.
|
---|
261 | * @param SetLoggingServiceRequest $postBody
|
---|
262 | * @param array $optParams Optional parameters.
|
---|
263 | * @return Operation
|
---|
264 | * @throws \Google\Service\Exception
|
---|
265 | */
|
---|
266 | public function setLogging($name, SetLoggingServiceRequest $postBody, $optParams = [])
|
---|
267 | {
|
---|
268 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
269 | $params = array_merge($params, $optParams);
|
---|
270 | return $this->call('setLogging', [$params], Operation::class);
|
---|
271 | }
|
---|
272 | /**
|
---|
273 | * Sets the maintenance policy for a cluster. (clusters.setMaintenancePolicy)
|
---|
274 | *
|
---|
275 | * @param string $name The name (project, location, cluster name) of the cluster
|
---|
276 | * to set maintenance policy. Specified in the format
|
---|
277 | * `projects/locations/clusters`.
|
---|
278 | * @param SetMaintenancePolicyRequest $postBody
|
---|
279 | * @param array $optParams Optional parameters.
|
---|
280 | * @return Operation
|
---|
281 | * @throws \Google\Service\Exception
|
---|
282 | */
|
---|
283 | public function setMaintenancePolicy($name, SetMaintenancePolicyRequest $postBody, $optParams = [])
|
---|
284 | {
|
---|
285 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
286 | $params = array_merge($params, $optParams);
|
---|
287 | return $this->call('setMaintenancePolicy', [$params], Operation::class);
|
---|
288 | }
|
---|
289 | /**
|
---|
290 | * Sets master auth materials. Currently supports changing the admin password or
|
---|
291 | * a specific cluster, either via password generation or explicitly setting the
|
---|
292 | * password. (clusters.setMasterAuth)
|
---|
293 | *
|
---|
294 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
295 | * set auth. Specified in the format `projects/locations/clusters`.
|
---|
296 | * @param SetMasterAuthRequest $postBody
|
---|
297 | * @param array $optParams Optional parameters.
|
---|
298 | * @return Operation
|
---|
299 | * @throws \Google\Service\Exception
|
---|
300 | */
|
---|
301 | public function setMasterAuth($name, SetMasterAuthRequest $postBody, $optParams = [])
|
---|
302 | {
|
---|
303 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
304 | $params = array_merge($params, $optParams);
|
---|
305 | return $this->call('setMasterAuth', [$params], Operation::class);
|
---|
306 | }
|
---|
307 | /**
|
---|
308 | * Sets the monitoring service for a specific cluster. (clusters.setMonitoring)
|
---|
309 | *
|
---|
310 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
311 | * set monitoring. Specified in the format `projects/locations/clusters`.
|
---|
312 | * @param SetMonitoringServiceRequest $postBody
|
---|
313 | * @param array $optParams Optional parameters.
|
---|
314 | * @return Operation
|
---|
315 | * @throws \Google\Service\Exception
|
---|
316 | */
|
---|
317 | public function setMonitoring($name, SetMonitoringServiceRequest $postBody, $optParams = [])
|
---|
318 | {
|
---|
319 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
320 | $params = array_merge($params, $optParams);
|
---|
321 | return $this->call('setMonitoring', [$params], Operation::class);
|
---|
322 | }
|
---|
323 | /**
|
---|
324 | * Enables or disables Network Policy for a cluster. (clusters.setNetworkPolicy)
|
---|
325 | *
|
---|
326 | * @param string $name The name (project, location, cluster name) of the cluster
|
---|
327 | * to set networking policy. Specified in the format
|
---|
328 | * `projects/locations/clusters`.
|
---|
329 | * @param SetNetworkPolicyRequest $postBody
|
---|
330 | * @param array $optParams Optional parameters.
|
---|
331 | * @return Operation
|
---|
332 | * @throws \Google\Service\Exception
|
---|
333 | */
|
---|
334 | public function setNetworkPolicy($name, SetNetworkPolicyRequest $postBody, $optParams = [])
|
---|
335 | {
|
---|
336 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
337 | $params = array_merge($params, $optParams);
|
---|
338 | return $this->call('setNetworkPolicy', [$params], Operation::class);
|
---|
339 | }
|
---|
340 | /**
|
---|
341 | * Sets labels on a cluster. (clusters.setResourceLabels)
|
---|
342 | *
|
---|
343 | * @param string $name The name (project, location, cluster name) of the cluster
|
---|
344 | * to set labels. Specified in the format `projects/locations/clusters`.
|
---|
345 | * @param SetLabelsRequest $postBody
|
---|
346 | * @param array $optParams Optional parameters.
|
---|
347 | * @return Operation
|
---|
348 | * @throws \Google\Service\Exception
|
---|
349 | */
|
---|
350 | public function setResourceLabels($name, SetLabelsRequest $postBody, $optParams = [])
|
---|
351 | {
|
---|
352 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
353 | $params = array_merge($params, $optParams);
|
---|
354 | return $this->call('setResourceLabels', [$params], Operation::class);
|
---|
355 | }
|
---|
356 | /**
|
---|
357 | * Starts master IP rotation. (clusters.startIpRotation)
|
---|
358 | *
|
---|
359 | * @param string $name The name (project, location, cluster name) of the cluster
|
---|
360 | * to start IP rotation. Specified in the format `projects/locations/clusters`.
|
---|
361 | * @param StartIPRotationRequest $postBody
|
---|
362 | * @param array $optParams Optional parameters.
|
---|
363 | * @return Operation
|
---|
364 | * @throws \Google\Service\Exception
|
---|
365 | */
|
---|
366 | public function startIpRotation($name, StartIPRotationRequest $postBody, $optParams = [])
|
---|
367 | {
|
---|
368 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
369 | $params = array_merge($params, $optParams);
|
---|
370 | return $this->call('startIpRotation', [$params], Operation::class);
|
---|
371 | }
|
---|
372 | /**
|
---|
373 | * Updates the settings of a specific cluster. (clusters.update)
|
---|
374 | *
|
---|
375 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
376 | * update. Specified in the format `projects/locations/clusters`.
|
---|
377 | * @param UpdateClusterRequest $postBody
|
---|
378 | * @param array $optParams Optional parameters.
|
---|
379 | * @return Operation
|
---|
380 | * @throws \Google\Service\Exception
|
---|
381 | */
|
---|
382 | public function update($name, UpdateClusterRequest $postBody, $optParams = [])
|
---|
383 | {
|
---|
384 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
385 | $params = array_merge($params, $optParams);
|
---|
386 | return $this->call('update', [$params], Operation::class);
|
---|
387 | }
|
---|
388 | /**
|
---|
389 | * Updates the master for a specific cluster. (clusters.updateMaster)
|
---|
390 | *
|
---|
391 | * @param string $name The name (project, location, cluster) of the cluster to
|
---|
392 | * update. Specified in the format `projects/locations/clusters`.
|
---|
393 | * @param UpdateMasterRequest $postBody
|
---|
394 | * @param array $optParams Optional parameters.
|
---|
395 | * @return Operation
|
---|
396 | * @throws \Google\Service\Exception
|
---|
397 | */
|
---|
398 | public function updateMaster($name, UpdateMasterRequest $postBody, $optParams = [])
|
---|
399 | {
|
---|
400 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
401 | $params = array_merge($params, $optParams);
|
---|
402 | return $this->call('updateMaster', [$params], Operation::class);
|
---|
403 | }
|
---|
404 | }
|
---|
405 |
|
---|
406 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
407 | class_alias(ProjectsLocationsClusters::class, 'Google_Service_Container_Resource_ProjectsLocationsClusters');
|
---|