google-cloud-container 2.56.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. google/cloud/container/__init__.py +393 -0
  2. google/cloud/container/gapic_version.py +16 -0
  3. google/cloud/container/py.typed +2 -0
  4. google/cloud/container_v1/__init__.py +388 -0
  5. google/cloud/container_v1/gapic_metadata.json +538 -0
  6. google/cloud/container_v1/gapic_version.py +16 -0
  7. google/cloud/container_v1/py.typed +2 -0
  8. google/cloud/container_v1/services/__init__.py +15 -0
  9. google/cloud/container_v1/services/cluster_manager/__init__.py +22 -0
  10. google/cloud/container_v1/services/cluster_manager/async_client.py +4985 -0
  11. google/cloud/container_v1/services/cluster_manager/client.py +5367 -0
  12. google/cloud/container_v1/services/cluster_manager/pagers.py +199 -0
  13. google/cloud/container_v1/services/cluster_manager/transports/__init__.py +36 -0
  14. google/cloud/container_v1/services/cluster_manager/transports/base.py +732 -0
  15. google/cloud/container_v1/services/cluster_manager/transports/grpc.py +1293 -0
  16. google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py +1619 -0
  17. google/cloud/container_v1/services/cluster_manager/transports/rest.py +7531 -0
  18. google/cloud/container_v1/services/cluster_manager/transports/rest_base.py +1796 -0
  19. google/cloud/container_v1/types/__init__.py +380 -0
  20. google/cloud/container_v1/types/cluster_service.py +10647 -0
  21. google/cloud/container_v1beta1/__init__.py +408 -0
  22. google/cloud/container_v1beta1/gapic_metadata.json +373 -0
  23. google/cloud/container_v1beta1/gapic_version.py +16 -0
  24. google/cloud/container_v1beta1/py.typed +2 -0
  25. google/cloud/container_v1beta1/services/__init__.py +15 -0
  26. google/cloud/container_v1beta1/services/cluster_manager/__init__.py +22 -0
  27. google/cloud/container_v1beta1/services/cluster_manager/async_client.py +5127 -0
  28. google/cloud/container_v1beta1/services/cluster_manager/client.py +5458 -0
  29. google/cloud/container_v1beta1/services/cluster_manager/pagers.py +199 -0
  30. google/cloud/container_v1beta1/services/cluster_manager/transports/__init__.py +32 -0
  31. google/cloud/container_v1beta1/services/cluster_manager/transports/base.py +769 -0
  32. google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py +1322 -0
  33. google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py +1674 -0
  34. google/cloud/container_v1beta1/types/__init__.py +400 -0
  35. google/cloud/container_v1beta1/types/cluster_service.py +11054 -0
  36. google_cloud_container-2.56.1.dist-info/LICENSE +202 -0
  37. google_cloud_container-2.56.1.dist-info/METADATA +228 -0
  38. google_cloud_container-2.56.1.dist-info/RECORD +40 -0
  39. google_cloud_container-2.56.1.dist-info/WHEEL +5 -0
  40. google_cloud_container-2.56.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1619 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ import inspect
17
+ import json
18
+ import logging as std_logging
19
+ import pickle
20
+ from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
21
+ import warnings
22
+
23
+ from google.api_core import exceptions as core_exceptions
24
+ from google.api_core import gapic_v1, grpc_helpers_async
25
+ from google.api_core import retry_async as retries
26
+ from google.auth import credentials as ga_credentials # type: ignore
27
+ from google.auth.transport.grpc import SslCredentials # type: ignore
28
+ from google.protobuf import empty_pb2 # type: ignore
29
+ from google.protobuf.json_format import MessageToJson
30
+ import google.protobuf.message
31
+ import grpc # type: ignore
32
+ from grpc.experimental import aio # type: ignore
33
+ import proto # type: ignore
34
+
35
+ from google.cloud.container_v1.types import cluster_service
36
+
37
+ from .base import DEFAULT_CLIENT_INFO, ClusterManagerTransport
38
+ from .grpc import ClusterManagerGrpcTransport
39
+
40
+ try:
41
+ from google.api_core import client_logging # type: ignore
42
+
43
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
44
+ except ImportError: # pragma: NO COVER
45
+ CLIENT_LOGGING_SUPPORTED = False
46
+
47
+ _LOGGER = std_logging.getLogger(__name__)
48
+
49
+
50
+ class _LoggingClientAIOInterceptor(
51
+ grpc.aio.UnaryUnaryClientInterceptor
52
+ ): # pragma: NO COVER
53
+ async def intercept_unary_unary(self, continuation, client_call_details, request):
54
+ logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
55
+ std_logging.DEBUG
56
+ )
57
+ if logging_enabled: # pragma: NO COVER
58
+ request_metadata = client_call_details.metadata
59
+ if isinstance(request, proto.Message):
60
+ request_payload = type(request).to_json(request)
61
+ elif isinstance(request, google.protobuf.message.Message):
62
+ request_payload = MessageToJson(request)
63
+ else:
64
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
65
+
66
+ request_metadata = {
67
+ key: value.decode("utf-8") if isinstance(value, bytes) else value
68
+ for key, value in request_metadata
69
+ }
70
+ grpc_request = {
71
+ "payload": request_payload,
72
+ "requestMethod": "grpc",
73
+ "metadata": dict(request_metadata),
74
+ }
75
+ _LOGGER.debug(
76
+ f"Sending request for {client_call_details.method}",
77
+ extra={
78
+ "serviceName": "google.container.v1.ClusterManager",
79
+ "rpcName": str(client_call_details.method),
80
+ "request": grpc_request,
81
+ "metadata": grpc_request["metadata"],
82
+ },
83
+ )
84
+ response = await continuation(client_call_details, request)
85
+ if logging_enabled: # pragma: NO COVER
86
+ response_metadata = await response.trailing_metadata()
87
+ # Convert gRPC metadata `<class 'grpc.aio._metadata.Metadata'>` to list of tuples
88
+ metadata = (
89
+ dict([(k, str(v)) for k, v in response_metadata])
90
+ if response_metadata
91
+ else None
92
+ )
93
+ result = await response
94
+ if isinstance(result, proto.Message):
95
+ response_payload = type(result).to_json(result)
96
+ elif isinstance(result, google.protobuf.message.Message):
97
+ response_payload = MessageToJson(result)
98
+ else:
99
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
100
+ grpc_response = {
101
+ "payload": response_payload,
102
+ "metadata": metadata,
103
+ "status": "OK",
104
+ }
105
+ _LOGGER.debug(
106
+ f"Received response to rpc {client_call_details.method}.",
107
+ extra={
108
+ "serviceName": "google.container.v1.ClusterManager",
109
+ "rpcName": str(client_call_details.method),
110
+ "response": grpc_response,
111
+ "metadata": grpc_response["metadata"],
112
+ },
113
+ )
114
+ return response
115
+
116
+
117
+ class ClusterManagerGrpcAsyncIOTransport(ClusterManagerTransport):
118
+ """gRPC AsyncIO backend transport for ClusterManager.
119
+
120
+ Google Kubernetes Engine Cluster Manager v1
121
+
122
+ This class defines the same methods as the primary client, so the
123
+ primary client can load the underlying transport implementation
124
+ and call it.
125
+
126
+ It sends protocol buffers over the wire using gRPC (which is built on
127
+ top of HTTP/2); the ``grpcio`` package must be installed.
128
+ """
129
+
130
+ _grpc_channel: aio.Channel
131
+ _stubs: Dict[str, Callable] = {}
132
+
133
+ @classmethod
134
+ def create_channel(
135
+ cls,
136
+ host: str = "container.googleapis.com",
137
+ credentials: Optional[ga_credentials.Credentials] = None,
138
+ credentials_file: Optional[str] = None,
139
+ scopes: Optional[Sequence[str]] = None,
140
+ quota_project_id: Optional[str] = None,
141
+ **kwargs,
142
+ ) -> aio.Channel:
143
+ """Create and return a gRPC AsyncIO channel object.
144
+ Args:
145
+ host (Optional[str]): The host for the channel to use.
146
+ credentials (Optional[~.Credentials]): The
147
+ authorization credentials to attach to requests. These
148
+ credentials identify this application to the service. If
149
+ none are specified, the client will attempt to ascertain
150
+ the credentials from the environment.
151
+ credentials_file (Optional[str]): A file with credentials that can
152
+ be loaded with :func:`google.auth.load_credentials_from_file`.
153
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
154
+ service. These are only used when credentials are not specified and
155
+ are passed to :func:`google.auth.default`.
156
+ quota_project_id (Optional[str]): An optional project to use for billing
157
+ and quota.
158
+ kwargs (Optional[dict]): Keyword arguments, which are passed to the
159
+ channel creation.
160
+ Returns:
161
+ aio.Channel: A gRPC AsyncIO channel object.
162
+ """
163
+
164
+ return grpc_helpers_async.create_channel(
165
+ host,
166
+ credentials=credentials,
167
+ credentials_file=credentials_file,
168
+ quota_project_id=quota_project_id,
169
+ default_scopes=cls.AUTH_SCOPES,
170
+ scopes=scopes,
171
+ default_host=cls.DEFAULT_HOST,
172
+ **kwargs,
173
+ )
174
+
175
+ def __init__(
176
+ self,
177
+ *,
178
+ host: str = "container.googleapis.com",
179
+ credentials: Optional[ga_credentials.Credentials] = None,
180
+ credentials_file: Optional[str] = None,
181
+ scopes: Optional[Sequence[str]] = None,
182
+ channel: Optional[Union[aio.Channel, Callable[..., aio.Channel]]] = None,
183
+ api_mtls_endpoint: Optional[str] = None,
184
+ client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
185
+ ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
186
+ client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
187
+ quota_project_id: Optional[str] = None,
188
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
189
+ always_use_jwt_access: Optional[bool] = False,
190
+ api_audience: Optional[str] = None,
191
+ ) -> None:
192
+ """Instantiate the transport.
193
+
194
+ Args:
195
+ host (Optional[str]):
196
+ The hostname to connect to (default: 'container.googleapis.com').
197
+ credentials (Optional[google.auth.credentials.Credentials]): The
198
+ authorization credentials to attach to requests. These
199
+ credentials identify the application to the service; if none
200
+ are specified, the client will attempt to ascertain the
201
+ credentials from the environment.
202
+ This argument is ignored if a ``channel`` instance is provided.
203
+ credentials_file (Optional[str]): A file with credentials that can
204
+ be loaded with :func:`google.auth.load_credentials_from_file`.
205
+ This argument is ignored if a ``channel`` instance is provided.
206
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
207
+ service. These are only used when credentials are not specified and
208
+ are passed to :func:`google.auth.default`.
209
+ channel (Optional[Union[aio.Channel, Callable[..., aio.Channel]]]):
210
+ A ``Channel`` instance through which to make calls, or a Callable
211
+ that constructs and returns one. If set to None, ``self.create_channel``
212
+ is used to create the channel. If a Callable is given, it will be called
213
+ with the same arguments as used in ``self.create_channel``.
214
+ api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
215
+ If provided, it overrides the ``host`` argument and tries to create
216
+ a mutual TLS channel with client SSL credentials from
217
+ ``client_cert_source`` or application default SSL credentials.
218
+ client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
219
+ Deprecated. A callback to provide client SSL certificate bytes and
220
+ private key bytes, both in PEM format. It is ignored if
221
+ ``api_mtls_endpoint`` is None.
222
+ ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
223
+ for the grpc channel. It is ignored if a ``channel`` instance is provided.
224
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
225
+ A callback to provide client certificate bytes and private key bytes,
226
+ both in PEM format. It is used to configure a mutual TLS channel. It is
227
+ ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
228
+ quota_project_id (Optional[str]): An optional project to use for billing
229
+ and quota.
230
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
231
+ The client info used to send a user-agent string along with
232
+ API requests. If ``None``, then default info will be used.
233
+ Generally, you only need to set this if you're developing
234
+ your own client library.
235
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
236
+ be used for service account credentials.
237
+
238
+ Raises:
239
+ google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
240
+ creation failed for any reason.
241
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
242
+ and ``credentials_file`` are passed.
243
+ """
244
+ self._grpc_channel = None
245
+ self._ssl_channel_credentials = ssl_channel_credentials
246
+ self._stubs: Dict[str, Callable] = {}
247
+
248
+ if api_mtls_endpoint:
249
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
250
+ if client_cert_source:
251
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
252
+
253
+ if isinstance(channel, aio.Channel):
254
+ # Ignore credentials if a channel was passed.
255
+ credentials = None
256
+ self._ignore_credentials = True
257
+ # If a channel was explicitly provided, set it.
258
+ self._grpc_channel = channel
259
+ self._ssl_channel_credentials = None
260
+ else:
261
+ if api_mtls_endpoint:
262
+ host = api_mtls_endpoint
263
+
264
+ # Create SSL credentials with client_cert_source or application
265
+ # default SSL credentials.
266
+ if client_cert_source:
267
+ cert, key = client_cert_source()
268
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
269
+ certificate_chain=cert, private_key=key
270
+ )
271
+ else:
272
+ self._ssl_channel_credentials = SslCredentials().ssl_credentials
273
+
274
+ else:
275
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
276
+ cert, key = client_cert_source_for_mtls()
277
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
278
+ certificate_chain=cert, private_key=key
279
+ )
280
+
281
+ # The base transport sets the host, credentials and scopes
282
+ super().__init__(
283
+ host=host,
284
+ credentials=credentials,
285
+ credentials_file=credentials_file,
286
+ scopes=scopes,
287
+ quota_project_id=quota_project_id,
288
+ client_info=client_info,
289
+ always_use_jwt_access=always_use_jwt_access,
290
+ api_audience=api_audience,
291
+ )
292
+
293
+ if not self._grpc_channel:
294
+ # initialize with the provided callable or the default channel
295
+ channel_init = channel or type(self).create_channel
296
+ self._grpc_channel = channel_init(
297
+ self._host,
298
+ # use the credentials which are saved
299
+ credentials=self._credentials,
300
+ # Set ``credentials_file`` to ``None`` here as
301
+ # the credentials that we saved earlier should be used.
302
+ credentials_file=None,
303
+ scopes=self._scopes,
304
+ ssl_credentials=self._ssl_channel_credentials,
305
+ quota_project_id=quota_project_id,
306
+ options=[
307
+ ("grpc.max_send_message_length", -1),
308
+ ("grpc.max_receive_message_length", -1),
309
+ ],
310
+ )
311
+
312
+ self._interceptor = _LoggingClientAIOInterceptor()
313
+ self._grpc_channel._unary_unary_interceptors.append(self._interceptor)
314
+ self._logged_channel = self._grpc_channel
315
+ self._wrap_with_kind = (
316
+ "kind" in inspect.signature(gapic_v1.method_async.wrap_method).parameters
317
+ )
318
+ # Wrap messages. This must be done after self._logged_channel exists
319
+ self._prep_wrapped_messages(client_info)
320
+
321
+ @property
322
+ def grpc_channel(self) -> aio.Channel:
323
+ """Create the channel designed to connect to this service.
324
+
325
+ This property caches on the instance; repeated calls return
326
+ the same channel.
327
+ """
328
+ # Return the channel from cache.
329
+ return self._grpc_channel
330
+
331
+ @property
332
+ def list_clusters(
333
+ self,
334
+ ) -> Callable[
335
+ [cluster_service.ListClustersRequest],
336
+ Awaitable[cluster_service.ListClustersResponse],
337
+ ]:
338
+ r"""Return a callable for the list clusters method over gRPC.
339
+
340
+ Lists all clusters owned by a project in either the
341
+ specified zone or all zones.
342
+
343
+ Returns:
344
+ Callable[[~.ListClustersRequest],
345
+ Awaitable[~.ListClustersResponse]]:
346
+ A function that, when called, will call the underlying RPC
347
+ on the server.
348
+ """
349
+ # Generate a "stub function" on-the-fly which will actually make
350
+ # the request.
351
+ # gRPC handles serialization and deserialization, so we just need
352
+ # to pass in the functions for each.
353
+ if "list_clusters" not in self._stubs:
354
+ self._stubs["list_clusters"] = self._logged_channel.unary_unary(
355
+ "/google.container.v1.ClusterManager/ListClusters",
356
+ request_serializer=cluster_service.ListClustersRequest.serialize,
357
+ response_deserializer=cluster_service.ListClustersResponse.deserialize,
358
+ )
359
+ return self._stubs["list_clusters"]
360
+
361
+ @property
362
+ def get_cluster(
363
+ self,
364
+ ) -> Callable[
365
+ [cluster_service.GetClusterRequest], Awaitable[cluster_service.Cluster]
366
+ ]:
367
+ r"""Return a callable for the get cluster method over gRPC.
368
+
369
+ Gets the details of a specific cluster.
370
+
371
+ Returns:
372
+ Callable[[~.GetClusterRequest],
373
+ Awaitable[~.Cluster]]:
374
+ A function that, when called, will call the underlying RPC
375
+ on the server.
376
+ """
377
+ # Generate a "stub function" on-the-fly which will actually make
378
+ # the request.
379
+ # gRPC handles serialization and deserialization, so we just need
380
+ # to pass in the functions for each.
381
+ if "get_cluster" not in self._stubs:
382
+ self._stubs["get_cluster"] = self._logged_channel.unary_unary(
383
+ "/google.container.v1.ClusterManager/GetCluster",
384
+ request_serializer=cluster_service.GetClusterRequest.serialize,
385
+ response_deserializer=cluster_service.Cluster.deserialize,
386
+ )
387
+ return self._stubs["get_cluster"]
388
+
389
+ @property
390
+ def create_cluster(
391
+ self,
392
+ ) -> Callable[
393
+ [cluster_service.CreateClusterRequest], Awaitable[cluster_service.Operation]
394
+ ]:
395
+ r"""Return a callable for the create cluster method over gRPC.
396
+
397
+ Creates a cluster, consisting of the specified number and type
398
+ of Google Compute Engine instances.
399
+
400
+ By default, the cluster is created in the project's `default
401
+ network <https://cloud.google.com/compute/docs/networks-and-firewalls#networks>`__.
402
+
403
+ One firewall is added for the cluster. After cluster creation,
404
+ the Kubelet creates routes for each node to allow the containers
405
+ on that node to communicate with all other instances in the
406
+ cluster.
407
+
408
+ Finally, an entry is added to the project's global metadata
409
+ indicating which CIDR range the cluster is using.
410
+
411
+ Returns:
412
+ Callable[[~.CreateClusterRequest],
413
+ Awaitable[~.Operation]]:
414
+ A function that, when called, will call the underlying RPC
415
+ on the server.
416
+ """
417
+ # Generate a "stub function" on-the-fly which will actually make
418
+ # the request.
419
+ # gRPC handles serialization and deserialization, so we just need
420
+ # to pass in the functions for each.
421
+ if "create_cluster" not in self._stubs:
422
+ self._stubs["create_cluster"] = self._logged_channel.unary_unary(
423
+ "/google.container.v1.ClusterManager/CreateCluster",
424
+ request_serializer=cluster_service.CreateClusterRequest.serialize,
425
+ response_deserializer=cluster_service.Operation.deserialize,
426
+ )
427
+ return self._stubs["create_cluster"]
428
+
429
+ @property
430
+ def update_cluster(
431
+ self,
432
+ ) -> Callable[
433
+ [cluster_service.UpdateClusterRequest], Awaitable[cluster_service.Operation]
434
+ ]:
435
+ r"""Return a callable for the update cluster method over gRPC.
436
+
437
+ Updates the settings of a specific cluster.
438
+
439
+ Returns:
440
+ Callable[[~.UpdateClusterRequest],
441
+ Awaitable[~.Operation]]:
442
+ A function that, when called, will call the underlying RPC
443
+ on the server.
444
+ """
445
+ # Generate a "stub function" on-the-fly which will actually make
446
+ # the request.
447
+ # gRPC handles serialization and deserialization, so we just need
448
+ # to pass in the functions for each.
449
+ if "update_cluster" not in self._stubs:
450
+ self._stubs["update_cluster"] = self._logged_channel.unary_unary(
451
+ "/google.container.v1.ClusterManager/UpdateCluster",
452
+ request_serializer=cluster_service.UpdateClusterRequest.serialize,
453
+ response_deserializer=cluster_service.Operation.deserialize,
454
+ )
455
+ return self._stubs["update_cluster"]
456
+
457
+ @property
458
+ def update_node_pool(
459
+ self,
460
+ ) -> Callable[
461
+ [cluster_service.UpdateNodePoolRequest], Awaitable[cluster_service.Operation]
462
+ ]:
463
+ r"""Return a callable for the update node pool method over gRPC.
464
+
465
+ Updates the version and/or image type for the
466
+ specified node pool.
467
+
468
+ Returns:
469
+ Callable[[~.UpdateNodePoolRequest],
470
+ Awaitable[~.Operation]]:
471
+ A function that, when called, will call the underlying RPC
472
+ on the server.
473
+ """
474
+ # Generate a "stub function" on-the-fly which will actually make
475
+ # the request.
476
+ # gRPC handles serialization and deserialization, so we just need
477
+ # to pass in the functions for each.
478
+ if "update_node_pool" not in self._stubs:
479
+ self._stubs["update_node_pool"] = self._logged_channel.unary_unary(
480
+ "/google.container.v1.ClusterManager/UpdateNodePool",
481
+ request_serializer=cluster_service.UpdateNodePoolRequest.serialize,
482
+ response_deserializer=cluster_service.Operation.deserialize,
483
+ )
484
+ return self._stubs["update_node_pool"]
485
+
486
+ @property
487
+ def set_node_pool_autoscaling(
488
+ self,
489
+ ) -> Callable[
490
+ [cluster_service.SetNodePoolAutoscalingRequest],
491
+ Awaitable[cluster_service.Operation],
492
+ ]:
493
+ r"""Return a callable for the set node pool autoscaling method over gRPC.
494
+
495
+ Sets the autoscaling settings for the specified node
496
+ pool.
497
+
498
+ Returns:
499
+ Callable[[~.SetNodePoolAutoscalingRequest],
500
+ Awaitable[~.Operation]]:
501
+ A function that, when called, will call the underlying RPC
502
+ on the server.
503
+ """
504
+ # Generate a "stub function" on-the-fly which will actually make
505
+ # the request.
506
+ # gRPC handles serialization and deserialization, so we just need
507
+ # to pass in the functions for each.
508
+ if "set_node_pool_autoscaling" not in self._stubs:
509
+ self._stubs["set_node_pool_autoscaling"] = self._logged_channel.unary_unary(
510
+ "/google.container.v1.ClusterManager/SetNodePoolAutoscaling",
511
+ request_serializer=cluster_service.SetNodePoolAutoscalingRequest.serialize,
512
+ response_deserializer=cluster_service.Operation.deserialize,
513
+ )
514
+ return self._stubs["set_node_pool_autoscaling"]
515
+
516
+ @property
517
+ def set_logging_service(
518
+ self,
519
+ ) -> Callable[
520
+ [cluster_service.SetLoggingServiceRequest], Awaitable[cluster_service.Operation]
521
+ ]:
522
+ r"""Return a callable for the set logging service method over gRPC.
523
+
524
+ Sets the logging service for a specific cluster.
525
+
526
+ Returns:
527
+ Callable[[~.SetLoggingServiceRequest],
528
+ Awaitable[~.Operation]]:
529
+ A function that, when called, will call the underlying RPC
530
+ on the server.
531
+ """
532
+ # Generate a "stub function" on-the-fly which will actually make
533
+ # the request.
534
+ # gRPC handles serialization and deserialization, so we just need
535
+ # to pass in the functions for each.
536
+ if "set_logging_service" not in self._stubs:
537
+ self._stubs["set_logging_service"] = self._logged_channel.unary_unary(
538
+ "/google.container.v1.ClusterManager/SetLoggingService",
539
+ request_serializer=cluster_service.SetLoggingServiceRequest.serialize,
540
+ response_deserializer=cluster_service.Operation.deserialize,
541
+ )
542
+ return self._stubs["set_logging_service"]
543
+
544
+ @property
545
+ def set_monitoring_service(
546
+ self,
547
+ ) -> Callable[
548
+ [cluster_service.SetMonitoringServiceRequest],
549
+ Awaitable[cluster_service.Operation],
550
+ ]:
551
+ r"""Return a callable for the set monitoring service method over gRPC.
552
+
553
+ Sets the monitoring service for a specific cluster.
554
+
555
+ Returns:
556
+ Callable[[~.SetMonitoringServiceRequest],
557
+ Awaitable[~.Operation]]:
558
+ A function that, when called, will call the underlying RPC
559
+ on the server.
560
+ """
561
+ # Generate a "stub function" on-the-fly which will actually make
562
+ # the request.
563
+ # gRPC handles serialization and deserialization, so we just need
564
+ # to pass in the functions for each.
565
+ if "set_monitoring_service" not in self._stubs:
566
+ self._stubs["set_monitoring_service"] = self._logged_channel.unary_unary(
567
+ "/google.container.v1.ClusterManager/SetMonitoringService",
568
+ request_serializer=cluster_service.SetMonitoringServiceRequest.serialize,
569
+ response_deserializer=cluster_service.Operation.deserialize,
570
+ )
571
+ return self._stubs["set_monitoring_service"]
572
+
573
+ @property
574
+ def set_addons_config(
575
+ self,
576
+ ) -> Callable[
577
+ [cluster_service.SetAddonsConfigRequest], Awaitable[cluster_service.Operation]
578
+ ]:
579
+ r"""Return a callable for the set addons config method over gRPC.
580
+
581
+ Sets the addons for a specific cluster.
582
+
583
+ Returns:
584
+ Callable[[~.SetAddonsConfigRequest],
585
+ Awaitable[~.Operation]]:
586
+ A function that, when called, will call the underlying RPC
587
+ on the server.
588
+ """
589
+ # Generate a "stub function" on-the-fly which will actually make
590
+ # the request.
591
+ # gRPC handles serialization and deserialization, so we just need
592
+ # to pass in the functions for each.
593
+ if "set_addons_config" not in self._stubs:
594
+ self._stubs["set_addons_config"] = self._logged_channel.unary_unary(
595
+ "/google.container.v1.ClusterManager/SetAddonsConfig",
596
+ request_serializer=cluster_service.SetAddonsConfigRequest.serialize,
597
+ response_deserializer=cluster_service.Operation.deserialize,
598
+ )
599
+ return self._stubs["set_addons_config"]
600
+
601
+ @property
602
+ def set_locations(
603
+ self,
604
+ ) -> Callable[
605
+ [cluster_service.SetLocationsRequest], Awaitable[cluster_service.Operation]
606
+ ]:
607
+ r"""Return a callable for the set locations method over gRPC.
608
+
609
+ Sets the locations for a specific cluster. Deprecated. Use
610
+ `projects.locations.clusters.update <https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.locations.clusters/update>`__
611
+ instead.
612
+
613
+ Returns:
614
+ Callable[[~.SetLocationsRequest],
615
+ Awaitable[~.Operation]]:
616
+ A function that, when called, will call the underlying RPC
617
+ on the server.
618
+ """
619
+ # Generate a "stub function" on-the-fly which will actually make
620
+ # the request.
621
+ # gRPC handles serialization and deserialization, so we just need
622
+ # to pass in the functions for each.
623
+ if "set_locations" not in self._stubs:
624
+ self._stubs["set_locations"] = self._logged_channel.unary_unary(
625
+ "/google.container.v1.ClusterManager/SetLocations",
626
+ request_serializer=cluster_service.SetLocationsRequest.serialize,
627
+ response_deserializer=cluster_service.Operation.deserialize,
628
+ )
629
+ return self._stubs["set_locations"]
630
+
631
+ @property
632
+ def update_master(
633
+ self,
634
+ ) -> Callable[
635
+ [cluster_service.UpdateMasterRequest], Awaitable[cluster_service.Operation]
636
+ ]:
637
+ r"""Return a callable for the update master method over gRPC.
638
+
639
+ Updates the master for a specific cluster.
640
+
641
+ Returns:
642
+ Callable[[~.UpdateMasterRequest],
643
+ Awaitable[~.Operation]]:
644
+ A function that, when called, will call the underlying RPC
645
+ on the server.
646
+ """
647
+ # Generate a "stub function" on-the-fly which will actually make
648
+ # the request.
649
+ # gRPC handles serialization and deserialization, so we just need
650
+ # to pass in the functions for each.
651
+ if "update_master" not in self._stubs:
652
+ self._stubs["update_master"] = self._logged_channel.unary_unary(
653
+ "/google.container.v1.ClusterManager/UpdateMaster",
654
+ request_serializer=cluster_service.UpdateMasterRequest.serialize,
655
+ response_deserializer=cluster_service.Operation.deserialize,
656
+ )
657
+ return self._stubs["update_master"]
658
+
659
+ @property
660
+ def set_master_auth(
661
+ self,
662
+ ) -> Callable[
663
+ [cluster_service.SetMasterAuthRequest], Awaitable[cluster_service.Operation]
664
+ ]:
665
+ r"""Return a callable for the set master auth method over gRPC.
666
+
667
+ Sets master auth materials. Currently supports
668
+ changing the admin password or a specific cluster,
669
+ either via password generation or explicitly setting the
670
+ password.
671
+
672
+ Returns:
673
+ Callable[[~.SetMasterAuthRequest],
674
+ Awaitable[~.Operation]]:
675
+ A function that, when called, will call the underlying RPC
676
+ on the server.
677
+ """
678
+ # Generate a "stub function" on-the-fly which will actually make
679
+ # the request.
680
+ # gRPC handles serialization and deserialization, so we just need
681
+ # to pass in the functions for each.
682
+ if "set_master_auth" not in self._stubs:
683
+ self._stubs["set_master_auth"] = self._logged_channel.unary_unary(
684
+ "/google.container.v1.ClusterManager/SetMasterAuth",
685
+ request_serializer=cluster_service.SetMasterAuthRequest.serialize,
686
+ response_deserializer=cluster_service.Operation.deserialize,
687
+ )
688
+ return self._stubs["set_master_auth"]
689
+
690
+ @property
691
+ def delete_cluster(
692
+ self,
693
+ ) -> Callable[
694
+ [cluster_service.DeleteClusterRequest], Awaitable[cluster_service.Operation]
695
+ ]:
696
+ r"""Return a callable for the delete cluster method over gRPC.
697
+
698
+ Deletes the cluster, including the Kubernetes
699
+ endpoint and all worker nodes.
700
+
701
+ Firewalls and routes that were configured during cluster
702
+ creation are also deleted.
703
+
704
+ Other Google Compute Engine resources that might be in
705
+ use by the cluster, such as load balancer resources, are
706
+ not deleted if they weren't present when the cluster was
707
+ initially created.
708
+
709
+ Returns:
710
+ Callable[[~.DeleteClusterRequest],
711
+ Awaitable[~.Operation]]:
712
+ A function that, when called, will call the underlying RPC
713
+ on the server.
714
+ """
715
+ # Generate a "stub function" on-the-fly which will actually make
716
+ # the request.
717
+ # gRPC handles serialization and deserialization, so we just need
718
+ # to pass in the functions for each.
719
+ if "delete_cluster" not in self._stubs:
720
+ self._stubs["delete_cluster"] = self._logged_channel.unary_unary(
721
+ "/google.container.v1.ClusterManager/DeleteCluster",
722
+ request_serializer=cluster_service.DeleteClusterRequest.serialize,
723
+ response_deserializer=cluster_service.Operation.deserialize,
724
+ )
725
+ return self._stubs["delete_cluster"]
726
+
727
+ @property
728
+ def list_operations(
729
+ self,
730
+ ) -> Callable[
731
+ [cluster_service.ListOperationsRequest],
732
+ Awaitable[cluster_service.ListOperationsResponse],
733
+ ]:
734
+ r"""Return a callable for the list operations method over gRPC.
735
+
736
+ Lists all operations in a project in a specific zone
737
+ or all zones.
738
+
739
+ Returns:
740
+ Callable[[~.ListOperationsRequest],
741
+ Awaitable[~.ListOperationsResponse]]:
742
+ A function that, when called, will call the underlying RPC
743
+ on the server.
744
+ """
745
+ # Generate a "stub function" on-the-fly which will actually make
746
+ # the request.
747
+ # gRPC handles serialization and deserialization, so we just need
748
+ # to pass in the functions for each.
749
+ if "list_operations" not in self._stubs:
750
+ self._stubs["list_operations"] = self._logged_channel.unary_unary(
751
+ "/google.container.v1.ClusterManager/ListOperations",
752
+ request_serializer=cluster_service.ListOperationsRequest.serialize,
753
+ response_deserializer=cluster_service.ListOperationsResponse.deserialize,
754
+ )
755
+ return self._stubs["list_operations"]
756
+
757
+ @property
758
+ def get_operation(
759
+ self,
760
+ ) -> Callable[
761
+ [cluster_service.GetOperationRequest], Awaitable[cluster_service.Operation]
762
+ ]:
763
+ r"""Return a callable for the get operation method over gRPC.
764
+
765
+ Gets the specified operation.
766
+
767
+ Returns:
768
+ Callable[[~.GetOperationRequest],
769
+ Awaitable[~.Operation]]:
770
+ A function that, when called, will call the underlying RPC
771
+ on the server.
772
+ """
773
+ # Generate a "stub function" on-the-fly which will actually make
774
+ # the request.
775
+ # gRPC handles serialization and deserialization, so we just need
776
+ # to pass in the functions for each.
777
+ if "get_operation" not in self._stubs:
778
+ self._stubs["get_operation"] = self._logged_channel.unary_unary(
779
+ "/google.container.v1.ClusterManager/GetOperation",
780
+ request_serializer=cluster_service.GetOperationRequest.serialize,
781
+ response_deserializer=cluster_service.Operation.deserialize,
782
+ )
783
+ return self._stubs["get_operation"]
784
+
785
+ @property
786
+ def cancel_operation(
787
+ self,
788
+ ) -> Callable[[cluster_service.CancelOperationRequest], Awaitable[empty_pb2.Empty]]:
789
+ r"""Return a callable for the cancel operation method over gRPC.
790
+
791
+ Cancels the specified operation.
792
+
793
+ Returns:
794
+ Callable[[~.CancelOperationRequest],
795
+ Awaitable[~.Empty]]:
796
+ A function that, when called, will call the underlying RPC
797
+ on the server.
798
+ """
799
+ # Generate a "stub function" on-the-fly which will actually make
800
+ # the request.
801
+ # gRPC handles serialization and deserialization, so we just need
802
+ # to pass in the functions for each.
803
+ if "cancel_operation" not in self._stubs:
804
+ self._stubs["cancel_operation"] = self._logged_channel.unary_unary(
805
+ "/google.container.v1.ClusterManager/CancelOperation",
806
+ request_serializer=cluster_service.CancelOperationRequest.serialize,
807
+ response_deserializer=empty_pb2.Empty.FromString,
808
+ )
809
+ return self._stubs["cancel_operation"]
810
+
811
+ @property
812
+ def get_server_config(
813
+ self,
814
+ ) -> Callable[
815
+ [cluster_service.GetServerConfigRequest],
816
+ Awaitable[cluster_service.ServerConfig],
817
+ ]:
818
+ r"""Return a callable for the get server config method over gRPC.
819
+
820
+ Returns configuration info about the Google
821
+ Kubernetes Engine service.
822
+
823
+ Returns:
824
+ Callable[[~.GetServerConfigRequest],
825
+ Awaitable[~.ServerConfig]]:
826
+ A function that, when called, will call the underlying RPC
827
+ on the server.
828
+ """
829
+ # Generate a "stub function" on-the-fly which will actually make
830
+ # the request.
831
+ # gRPC handles serialization and deserialization, so we just need
832
+ # to pass in the functions for each.
833
+ if "get_server_config" not in self._stubs:
834
+ self._stubs["get_server_config"] = self._logged_channel.unary_unary(
835
+ "/google.container.v1.ClusterManager/GetServerConfig",
836
+ request_serializer=cluster_service.GetServerConfigRequest.serialize,
837
+ response_deserializer=cluster_service.ServerConfig.deserialize,
838
+ )
839
+ return self._stubs["get_server_config"]
840
+
841
+ @property
842
+ def get_json_web_keys(
843
+ self,
844
+ ) -> Callable[
845
+ [cluster_service.GetJSONWebKeysRequest],
846
+ Awaitable[cluster_service.GetJSONWebKeysResponse],
847
+ ]:
848
+ r"""Return a callable for the get json web keys method over gRPC.
849
+
850
+ Gets the public component of the cluster signing keys
851
+ in JSON Web Key format.
852
+
853
+ Returns:
854
+ Callable[[~.GetJSONWebKeysRequest],
855
+ Awaitable[~.GetJSONWebKeysResponse]]:
856
+ A function that, when called, will call the underlying RPC
857
+ on the server.
858
+ """
859
+ # Generate a "stub function" on-the-fly which will actually make
860
+ # the request.
861
+ # gRPC handles serialization and deserialization, so we just need
862
+ # to pass in the functions for each.
863
+ if "get_json_web_keys" not in self._stubs:
864
+ self._stubs["get_json_web_keys"] = self._logged_channel.unary_unary(
865
+ "/google.container.v1.ClusterManager/GetJSONWebKeys",
866
+ request_serializer=cluster_service.GetJSONWebKeysRequest.serialize,
867
+ response_deserializer=cluster_service.GetJSONWebKeysResponse.deserialize,
868
+ )
869
+ return self._stubs["get_json_web_keys"]
870
+
871
+ @property
872
+ def list_node_pools(
873
+ self,
874
+ ) -> Callable[
875
+ [cluster_service.ListNodePoolsRequest],
876
+ Awaitable[cluster_service.ListNodePoolsResponse],
877
+ ]:
878
+ r"""Return a callable for the list node pools method over gRPC.
879
+
880
+ Lists the node pools for a cluster.
881
+
882
+ Returns:
883
+ Callable[[~.ListNodePoolsRequest],
884
+ Awaitable[~.ListNodePoolsResponse]]:
885
+ A function that, when called, will call the underlying RPC
886
+ on the server.
887
+ """
888
+ # Generate a "stub function" on-the-fly which will actually make
889
+ # the request.
890
+ # gRPC handles serialization and deserialization, so we just need
891
+ # to pass in the functions for each.
892
+ if "list_node_pools" not in self._stubs:
893
+ self._stubs["list_node_pools"] = self._logged_channel.unary_unary(
894
+ "/google.container.v1.ClusterManager/ListNodePools",
895
+ request_serializer=cluster_service.ListNodePoolsRequest.serialize,
896
+ response_deserializer=cluster_service.ListNodePoolsResponse.deserialize,
897
+ )
898
+ return self._stubs["list_node_pools"]
899
+
900
+ @property
901
+ def get_node_pool(
902
+ self,
903
+ ) -> Callable[
904
+ [cluster_service.GetNodePoolRequest], Awaitable[cluster_service.NodePool]
905
+ ]:
906
+ r"""Return a callable for the get node pool method over gRPC.
907
+
908
+ Retrieves the requested node pool.
909
+
910
+ Returns:
911
+ Callable[[~.GetNodePoolRequest],
912
+ Awaitable[~.NodePool]]:
913
+ A function that, when called, will call the underlying RPC
914
+ on the server.
915
+ """
916
+ # Generate a "stub function" on-the-fly which will actually make
917
+ # the request.
918
+ # gRPC handles serialization and deserialization, so we just need
919
+ # to pass in the functions for each.
920
+ if "get_node_pool" not in self._stubs:
921
+ self._stubs["get_node_pool"] = self._logged_channel.unary_unary(
922
+ "/google.container.v1.ClusterManager/GetNodePool",
923
+ request_serializer=cluster_service.GetNodePoolRequest.serialize,
924
+ response_deserializer=cluster_service.NodePool.deserialize,
925
+ )
926
+ return self._stubs["get_node_pool"]
927
+
928
+ @property
929
+ def create_node_pool(
930
+ self,
931
+ ) -> Callable[
932
+ [cluster_service.CreateNodePoolRequest], Awaitable[cluster_service.Operation]
933
+ ]:
934
+ r"""Return a callable for the create node pool method over gRPC.
935
+
936
+ Creates a node pool for a cluster.
937
+
938
+ Returns:
939
+ Callable[[~.CreateNodePoolRequest],
940
+ Awaitable[~.Operation]]:
941
+ A function that, when called, will call the underlying RPC
942
+ on the server.
943
+ """
944
+ # Generate a "stub function" on-the-fly which will actually make
945
+ # the request.
946
+ # gRPC handles serialization and deserialization, so we just need
947
+ # to pass in the functions for each.
948
+ if "create_node_pool" not in self._stubs:
949
+ self._stubs["create_node_pool"] = self._logged_channel.unary_unary(
950
+ "/google.container.v1.ClusterManager/CreateNodePool",
951
+ request_serializer=cluster_service.CreateNodePoolRequest.serialize,
952
+ response_deserializer=cluster_service.Operation.deserialize,
953
+ )
954
+ return self._stubs["create_node_pool"]
955
+
956
+ @property
957
+ def delete_node_pool(
958
+ self,
959
+ ) -> Callable[
960
+ [cluster_service.DeleteNodePoolRequest], Awaitable[cluster_service.Operation]
961
+ ]:
962
+ r"""Return a callable for the delete node pool method over gRPC.
963
+
964
+ Deletes a node pool from a cluster.
965
+
966
+ Returns:
967
+ Callable[[~.DeleteNodePoolRequest],
968
+ Awaitable[~.Operation]]:
969
+ A function that, when called, will call the underlying RPC
970
+ on the server.
971
+ """
972
+ # Generate a "stub function" on-the-fly which will actually make
973
+ # the request.
974
+ # gRPC handles serialization and deserialization, so we just need
975
+ # to pass in the functions for each.
976
+ if "delete_node_pool" not in self._stubs:
977
+ self._stubs["delete_node_pool"] = self._logged_channel.unary_unary(
978
+ "/google.container.v1.ClusterManager/DeleteNodePool",
979
+ request_serializer=cluster_service.DeleteNodePoolRequest.serialize,
980
+ response_deserializer=cluster_service.Operation.deserialize,
981
+ )
982
+ return self._stubs["delete_node_pool"]
983
+
984
+ @property
985
+ def complete_node_pool_upgrade(
986
+ self,
987
+ ) -> Callable[
988
+ [cluster_service.CompleteNodePoolUpgradeRequest], Awaitable[empty_pb2.Empty]
989
+ ]:
990
+ r"""Return a callable for the complete node pool upgrade method over gRPC.
991
+
992
+ CompleteNodePoolUpgrade will signal an on-going node
993
+ pool upgrade to complete.
994
+
995
+ Returns:
996
+ Callable[[~.CompleteNodePoolUpgradeRequest],
997
+ Awaitable[~.Empty]]:
998
+ A function that, when called, will call the underlying RPC
999
+ on the server.
1000
+ """
1001
+ # Generate a "stub function" on-the-fly which will actually make
1002
+ # the request.
1003
+ # gRPC handles serialization and deserialization, so we just need
1004
+ # to pass in the functions for each.
1005
+ if "complete_node_pool_upgrade" not in self._stubs:
1006
+ self._stubs[
1007
+ "complete_node_pool_upgrade"
1008
+ ] = self._logged_channel.unary_unary(
1009
+ "/google.container.v1.ClusterManager/CompleteNodePoolUpgrade",
1010
+ request_serializer=cluster_service.CompleteNodePoolUpgradeRequest.serialize,
1011
+ response_deserializer=empty_pb2.Empty.FromString,
1012
+ )
1013
+ return self._stubs["complete_node_pool_upgrade"]
1014
+
1015
+ @property
1016
+ def rollback_node_pool_upgrade(
1017
+ self,
1018
+ ) -> Callable[
1019
+ [cluster_service.RollbackNodePoolUpgradeRequest],
1020
+ Awaitable[cluster_service.Operation],
1021
+ ]:
1022
+ r"""Return a callable for the rollback node pool upgrade method over gRPC.
1023
+
1024
+ Rolls back a previously Aborted or Failed NodePool
1025
+ upgrade. This makes no changes if the last upgrade
1026
+ successfully completed.
1027
+
1028
+ Returns:
1029
+ Callable[[~.RollbackNodePoolUpgradeRequest],
1030
+ Awaitable[~.Operation]]:
1031
+ A function that, when called, will call the underlying RPC
1032
+ on the server.
1033
+ """
1034
+ # Generate a "stub function" on-the-fly which will actually make
1035
+ # the request.
1036
+ # gRPC handles serialization and deserialization, so we just need
1037
+ # to pass in the functions for each.
1038
+ if "rollback_node_pool_upgrade" not in self._stubs:
1039
+ self._stubs[
1040
+ "rollback_node_pool_upgrade"
1041
+ ] = self._logged_channel.unary_unary(
1042
+ "/google.container.v1.ClusterManager/RollbackNodePoolUpgrade",
1043
+ request_serializer=cluster_service.RollbackNodePoolUpgradeRequest.serialize,
1044
+ response_deserializer=cluster_service.Operation.deserialize,
1045
+ )
1046
+ return self._stubs["rollback_node_pool_upgrade"]
1047
+
1048
+ @property
1049
+ def set_node_pool_management(
1050
+ self,
1051
+ ) -> Callable[
1052
+ [cluster_service.SetNodePoolManagementRequest],
1053
+ Awaitable[cluster_service.Operation],
1054
+ ]:
1055
+ r"""Return a callable for the set node pool management method over gRPC.
1056
+
1057
+ Sets the NodeManagement options for a node pool.
1058
+
1059
+ Returns:
1060
+ Callable[[~.SetNodePoolManagementRequest],
1061
+ Awaitable[~.Operation]]:
1062
+ A function that, when called, will call the underlying RPC
1063
+ on the server.
1064
+ """
1065
+ # Generate a "stub function" on-the-fly which will actually make
1066
+ # the request.
1067
+ # gRPC handles serialization and deserialization, so we just need
1068
+ # to pass in the functions for each.
1069
+ if "set_node_pool_management" not in self._stubs:
1070
+ self._stubs["set_node_pool_management"] = self._logged_channel.unary_unary(
1071
+ "/google.container.v1.ClusterManager/SetNodePoolManagement",
1072
+ request_serializer=cluster_service.SetNodePoolManagementRequest.serialize,
1073
+ response_deserializer=cluster_service.Operation.deserialize,
1074
+ )
1075
+ return self._stubs["set_node_pool_management"]
1076
+
1077
+ @property
1078
+ def set_labels(
1079
+ self,
1080
+ ) -> Callable[
1081
+ [cluster_service.SetLabelsRequest], Awaitable[cluster_service.Operation]
1082
+ ]:
1083
+ r"""Return a callable for the set labels method over gRPC.
1084
+
1085
+ Sets labels on a cluster.
1086
+
1087
+ Returns:
1088
+ Callable[[~.SetLabelsRequest],
1089
+ Awaitable[~.Operation]]:
1090
+ A function that, when called, will call the underlying RPC
1091
+ on the server.
1092
+ """
1093
+ # Generate a "stub function" on-the-fly which will actually make
1094
+ # the request.
1095
+ # gRPC handles serialization and deserialization, so we just need
1096
+ # to pass in the functions for each.
1097
+ if "set_labels" not in self._stubs:
1098
+ self._stubs["set_labels"] = self._logged_channel.unary_unary(
1099
+ "/google.container.v1.ClusterManager/SetLabels",
1100
+ request_serializer=cluster_service.SetLabelsRequest.serialize,
1101
+ response_deserializer=cluster_service.Operation.deserialize,
1102
+ )
1103
+ return self._stubs["set_labels"]
1104
+
1105
+ @property
1106
+ def set_legacy_abac(
1107
+ self,
1108
+ ) -> Callable[
1109
+ [cluster_service.SetLegacyAbacRequest], Awaitable[cluster_service.Operation]
1110
+ ]:
1111
+ r"""Return a callable for the set legacy abac method over gRPC.
1112
+
1113
+ Enables or disables the ABAC authorization mechanism
1114
+ on a cluster.
1115
+
1116
+ Returns:
1117
+ Callable[[~.SetLegacyAbacRequest],
1118
+ Awaitable[~.Operation]]:
1119
+ A function that, when called, will call the underlying RPC
1120
+ on the server.
1121
+ """
1122
+ # Generate a "stub function" on-the-fly which will actually make
1123
+ # the request.
1124
+ # gRPC handles serialization and deserialization, so we just need
1125
+ # to pass in the functions for each.
1126
+ if "set_legacy_abac" not in self._stubs:
1127
+ self._stubs["set_legacy_abac"] = self._logged_channel.unary_unary(
1128
+ "/google.container.v1.ClusterManager/SetLegacyAbac",
1129
+ request_serializer=cluster_service.SetLegacyAbacRequest.serialize,
1130
+ response_deserializer=cluster_service.Operation.deserialize,
1131
+ )
1132
+ return self._stubs["set_legacy_abac"]
1133
+
1134
+ @property
1135
+ def start_ip_rotation(
1136
+ self,
1137
+ ) -> Callable[
1138
+ [cluster_service.StartIPRotationRequest], Awaitable[cluster_service.Operation]
1139
+ ]:
1140
+ r"""Return a callable for the start ip rotation method over gRPC.
1141
+
1142
+ Starts master IP rotation.
1143
+
1144
+ Returns:
1145
+ Callable[[~.StartIPRotationRequest],
1146
+ Awaitable[~.Operation]]:
1147
+ A function that, when called, will call the underlying RPC
1148
+ on the server.
1149
+ """
1150
+ # Generate a "stub function" on-the-fly which will actually make
1151
+ # the request.
1152
+ # gRPC handles serialization and deserialization, so we just need
1153
+ # to pass in the functions for each.
1154
+ if "start_ip_rotation" not in self._stubs:
1155
+ self._stubs["start_ip_rotation"] = self._logged_channel.unary_unary(
1156
+ "/google.container.v1.ClusterManager/StartIPRotation",
1157
+ request_serializer=cluster_service.StartIPRotationRequest.serialize,
1158
+ response_deserializer=cluster_service.Operation.deserialize,
1159
+ )
1160
+ return self._stubs["start_ip_rotation"]
1161
+
1162
+ @property
1163
+ def complete_ip_rotation(
1164
+ self,
1165
+ ) -> Callable[
1166
+ [cluster_service.CompleteIPRotationRequest],
1167
+ Awaitable[cluster_service.Operation],
1168
+ ]:
1169
+ r"""Return a callable for the complete ip rotation method over gRPC.
1170
+
1171
+ Completes master IP rotation.
1172
+
1173
+ Returns:
1174
+ Callable[[~.CompleteIPRotationRequest],
1175
+ Awaitable[~.Operation]]:
1176
+ A function that, when called, will call the underlying RPC
1177
+ on the server.
1178
+ """
1179
+ # Generate a "stub function" on-the-fly which will actually make
1180
+ # the request.
1181
+ # gRPC handles serialization and deserialization, so we just need
1182
+ # to pass in the functions for each.
1183
+ if "complete_ip_rotation" not in self._stubs:
1184
+ self._stubs["complete_ip_rotation"] = self._logged_channel.unary_unary(
1185
+ "/google.container.v1.ClusterManager/CompleteIPRotation",
1186
+ request_serializer=cluster_service.CompleteIPRotationRequest.serialize,
1187
+ response_deserializer=cluster_service.Operation.deserialize,
1188
+ )
1189
+ return self._stubs["complete_ip_rotation"]
1190
+
1191
+ @property
1192
+ def set_node_pool_size(
1193
+ self,
1194
+ ) -> Callable[
1195
+ [cluster_service.SetNodePoolSizeRequest], Awaitable[cluster_service.Operation]
1196
+ ]:
1197
+ r"""Return a callable for the set node pool size method over gRPC.
1198
+
1199
+ Sets the size for a specific node pool. The new size will be
1200
+ used for all replicas, including future replicas created by
1201
+ modifying
1202
+ [NodePool.locations][google.container.v1.NodePool.locations].
1203
+
1204
+ Returns:
1205
+ Callable[[~.SetNodePoolSizeRequest],
1206
+ Awaitable[~.Operation]]:
1207
+ A function that, when called, will call the underlying RPC
1208
+ on the server.
1209
+ """
1210
+ # Generate a "stub function" on-the-fly which will actually make
1211
+ # the request.
1212
+ # gRPC handles serialization and deserialization, so we just need
1213
+ # to pass in the functions for each.
1214
+ if "set_node_pool_size" not in self._stubs:
1215
+ self._stubs["set_node_pool_size"] = self._logged_channel.unary_unary(
1216
+ "/google.container.v1.ClusterManager/SetNodePoolSize",
1217
+ request_serializer=cluster_service.SetNodePoolSizeRequest.serialize,
1218
+ response_deserializer=cluster_service.Operation.deserialize,
1219
+ )
1220
+ return self._stubs["set_node_pool_size"]
1221
+
1222
+ @property
1223
+ def set_network_policy(
1224
+ self,
1225
+ ) -> Callable[
1226
+ [cluster_service.SetNetworkPolicyRequest], Awaitable[cluster_service.Operation]
1227
+ ]:
1228
+ r"""Return a callable for the set network policy method over gRPC.
1229
+
1230
+ Enables or disables Network Policy for a cluster.
1231
+
1232
+ Returns:
1233
+ Callable[[~.SetNetworkPolicyRequest],
1234
+ Awaitable[~.Operation]]:
1235
+ A function that, when called, will call the underlying RPC
1236
+ on the server.
1237
+ """
1238
+ # Generate a "stub function" on-the-fly which will actually make
1239
+ # the request.
1240
+ # gRPC handles serialization and deserialization, so we just need
1241
+ # to pass in the functions for each.
1242
+ if "set_network_policy" not in self._stubs:
1243
+ self._stubs["set_network_policy"] = self._logged_channel.unary_unary(
1244
+ "/google.container.v1.ClusterManager/SetNetworkPolicy",
1245
+ request_serializer=cluster_service.SetNetworkPolicyRequest.serialize,
1246
+ response_deserializer=cluster_service.Operation.deserialize,
1247
+ )
1248
+ return self._stubs["set_network_policy"]
1249
+
1250
+ @property
1251
+ def set_maintenance_policy(
1252
+ self,
1253
+ ) -> Callable[
1254
+ [cluster_service.SetMaintenancePolicyRequest],
1255
+ Awaitable[cluster_service.Operation],
1256
+ ]:
1257
+ r"""Return a callable for the set maintenance policy method over gRPC.
1258
+
1259
+ Sets the maintenance policy for a cluster.
1260
+
1261
+ Returns:
1262
+ Callable[[~.SetMaintenancePolicyRequest],
1263
+ Awaitable[~.Operation]]:
1264
+ A function that, when called, will call the underlying RPC
1265
+ on the server.
1266
+ """
1267
+ # Generate a "stub function" on-the-fly which will actually make
1268
+ # the request.
1269
+ # gRPC handles serialization and deserialization, so we just need
1270
+ # to pass in the functions for each.
1271
+ if "set_maintenance_policy" not in self._stubs:
1272
+ self._stubs["set_maintenance_policy"] = self._logged_channel.unary_unary(
1273
+ "/google.container.v1.ClusterManager/SetMaintenancePolicy",
1274
+ request_serializer=cluster_service.SetMaintenancePolicyRequest.serialize,
1275
+ response_deserializer=cluster_service.Operation.deserialize,
1276
+ )
1277
+ return self._stubs["set_maintenance_policy"]
1278
+
1279
+ @property
1280
+ def list_usable_subnetworks(
1281
+ self,
1282
+ ) -> Callable[
1283
+ [cluster_service.ListUsableSubnetworksRequest],
1284
+ Awaitable[cluster_service.ListUsableSubnetworksResponse],
1285
+ ]:
1286
+ r"""Return a callable for the list usable subnetworks method over gRPC.
1287
+
1288
+ Lists subnetworks that are usable for creating
1289
+ clusters in a project.
1290
+
1291
+ Returns:
1292
+ Callable[[~.ListUsableSubnetworksRequest],
1293
+ Awaitable[~.ListUsableSubnetworksResponse]]:
1294
+ A function that, when called, will call the underlying RPC
1295
+ on the server.
1296
+ """
1297
+ # Generate a "stub function" on-the-fly which will actually make
1298
+ # the request.
1299
+ # gRPC handles serialization and deserialization, so we just need
1300
+ # to pass in the functions for each.
1301
+ if "list_usable_subnetworks" not in self._stubs:
1302
+ self._stubs["list_usable_subnetworks"] = self._logged_channel.unary_unary(
1303
+ "/google.container.v1.ClusterManager/ListUsableSubnetworks",
1304
+ request_serializer=cluster_service.ListUsableSubnetworksRequest.serialize,
1305
+ response_deserializer=cluster_service.ListUsableSubnetworksResponse.deserialize,
1306
+ )
1307
+ return self._stubs["list_usable_subnetworks"]
1308
+
1309
+ @property
1310
+ def check_autopilot_compatibility(
1311
+ self,
1312
+ ) -> Callable[
1313
+ [cluster_service.CheckAutopilotCompatibilityRequest],
1314
+ Awaitable[cluster_service.CheckAutopilotCompatibilityResponse],
1315
+ ]:
1316
+ r"""Return a callable for the check autopilot compatibility method over gRPC.
1317
+
1318
+ Checks the cluster compatibility with Autopilot mode,
1319
+ and returns a list of compatibility issues.
1320
+
1321
+ Returns:
1322
+ Callable[[~.CheckAutopilotCompatibilityRequest],
1323
+ Awaitable[~.CheckAutopilotCompatibilityResponse]]:
1324
+ A function that, when called, will call the underlying RPC
1325
+ on the server.
1326
+ """
1327
+ # Generate a "stub function" on-the-fly which will actually make
1328
+ # the request.
1329
+ # gRPC handles serialization and deserialization, so we just need
1330
+ # to pass in the functions for each.
1331
+ if "check_autopilot_compatibility" not in self._stubs:
1332
+ self._stubs[
1333
+ "check_autopilot_compatibility"
1334
+ ] = self._logged_channel.unary_unary(
1335
+ "/google.container.v1.ClusterManager/CheckAutopilotCompatibility",
1336
+ request_serializer=cluster_service.CheckAutopilotCompatibilityRequest.serialize,
1337
+ response_deserializer=cluster_service.CheckAutopilotCompatibilityResponse.deserialize,
1338
+ )
1339
+ return self._stubs["check_autopilot_compatibility"]
1340
+
1341
+ def _prep_wrapped_messages(self, client_info):
1342
+ """Precompute the wrapped methods, overriding the base class method to use async wrappers."""
1343
+ self._wrapped_methods = {
1344
+ self.list_clusters: self._wrap_method(
1345
+ self.list_clusters,
1346
+ default_retry=retries.AsyncRetry(
1347
+ initial=0.1,
1348
+ maximum=60.0,
1349
+ multiplier=1.3,
1350
+ predicate=retries.if_exception_type(
1351
+ core_exceptions.DeadlineExceeded,
1352
+ core_exceptions.ServiceUnavailable,
1353
+ ),
1354
+ deadline=20.0,
1355
+ ),
1356
+ default_timeout=20.0,
1357
+ client_info=client_info,
1358
+ ),
1359
+ self.get_cluster: self._wrap_method(
1360
+ self.get_cluster,
1361
+ default_retry=retries.AsyncRetry(
1362
+ initial=0.1,
1363
+ maximum=60.0,
1364
+ multiplier=1.3,
1365
+ predicate=retries.if_exception_type(
1366
+ core_exceptions.DeadlineExceeded,
1367
+ core_exceptions.ServiceUnavailable,
1368
+ ),
1369
+ deadline=20.0,
1370
+ ),
1371
+ default_timeout=20.0,
1372
+ client_info=client_info,
1373
+ ),
1374
+ self.create_cluster: self._wrap_method(
1375
+ self.create_cluster,
1376
+ default_timeout=45.0,
1377
+ client_info=client_info,
1378
+ ),
1379
+ self.update_cluster: self._wrap_method(
1380
+ self.update_cluster,
1381
+ default_timeout=45.0,
1382
+ client_info=client_info,
1383
+ ),
1384
+ self.update_node_pool: self._wrap_method(
1385
+ self.update_node_pool,
1386
+ default_timeout=45.0,
1387
+ client_info=client_info,
1388
+ ),
1389
+ self.set_node_pool_autoscaling: self._wrap_method(
1390
+ self.set_node_pool_autoscaling,
1391
+ default_timeout=45.0,
1392
+ client_info=client_info,
1393
+ ),
1394
+ self.set_logging_service: self._wrap_method(
1395
+ self.set_logging_service,
1396
+ default_timeout=45.0,
1397
+ client_info=client_info,
1398
+ ),
1399
+ self.set_monitoring_service: self._wrap_method(
1400
+ self.set_monitoring_service,
1401
+ default_timeout=45.0,
1402
+ client_info=client_info,
1403
+ ),
1404
+ self.set_addons_config: self._wrap_method(
1405
+ self.set_addons_config,
1406
+ default_timeout=45.0,
1407
+ client_info=client_info,
1408
+ ),
1409
+ self.set_locations: self._wrap_method(
1410
+ self.set_locations,
1411
+ default_timeout=45.0,
1412
+ client_info=client_info,
1413
+ ),
1414
+ self.update_master: self._wrap_method(
1415
+ self.update_master,
1416
+ default_timeout=45.0,
1417
+ client_info=client_info,
1418
+ ),
1419
+ self.set_master_auth: self._wrap_method(
1420
+ self.set_master_auth,
1421
+ default_timeout=45.0,
1422
+ client_info=client_info,
1423
+ ),
1424
+ self.delete_cluster: self._wrap_method(
1425
+ self.delete_cluster,
1426
+ default_retry=retries.AsyncRetry(
1427
+ initial=0.1,
1428
+ maximum=60.0,
1429
+ multiplier=1.3,
1430
+ predicate=retries.if_exception_type(
1431
+ core_exceptions.DeadlineExceeded,
1432
+ core_exceptions.ServiceUnavailable,
1433
+ ),
1434
+ deadline=20.0,
1435
+ ),
1436
+ default_timeout=20.0,
1437
+ client_info=client_info,
1438
+ ),
1439
+ self.list_operations: self._wrap_method(
1440
+ self.list_operations,
1441
+ default_retry=retries.AsyncRetry(
1442
+ initial=0.1,
1443
+ maximum=60.0,
1444
+ multiplier=1.3,
1445
+ predicate=retries.if_exception_type(
1446
+ core_exceptions.DeadlineExceeded,
1447
+ core_exceptions.ServiceUnavailable,
1448
+ ),
1449
+ deadline=20.0,
1450
+ ),
1451
+ default_timeout=20.0,
1452
+ client_info=client_info,
1453
+ ),
1454
+ self.get_operation: self._wrap_method(
1455
+ self.get_operation,
1456
+ default_retry=retries.AsyncRetry(
1457
+ initial=0.1,
1458
+ maximum=60.0,
1459
+ multiplier=1.3,
1460
+ predicate=retries.if_exception_type(
1461
+ core_exceptions.DeadlineExceeded,
1462
+ core_exceptions.ServiceUnavailable,
1463
+ ),
1464
+ deadline=20.0,
1465
+ ),
1466
+ default_timeout=20.0,
1467
+ client_info=client_info,
1468
+ ),
1469
+ self.cancel_operation: self._wrap_method(
1470
+ self.cancel_operation,
1471
+ default_timeout=45.0,
1472
+ client_info=client_info,
1473
+ ),
1474
+ self.get_server_config: self._wrap_method(
1475
+ self.get_server_config,
1476
+ default_retry=retries.AsyncRetry(
1477
+ initial=0.1,
1478
+ maximum=60.0,
1479
+ multiplier=1.3,
1480
+ predicate=retries.if_exception_type(
1481
+ core_exceptions.DeadlineExceeded,
1482
+ core_exceptions.ServiceUnavailable,
1483
+ ),
1484
+ deadline=20.0,
1485
+ ),
1486
+ default_timeout=20.0,
1487
+ client_info=client_info,
1488
+ ),
1489
+ self.get_json_web_keys: self._wrap_method(
1490
+ self.get_json_web_keys,
1491
+ default_timeout=None,
1492
+ client_info=client_info,
1493
+ ),
1494
+ self.list_node_pools: self._wrap_method(
1495
+ self.list_node_pools,
1496
+ default_retry=retries.AsyncRetry(
1497
+ initial=0.1,
1498
+ maximum=60.0,
1499
+ multiplier=1.3,
1500
+ predicate=retries.if_exception_type(
1501
+ core_exceptions.DeadlineExceeded,
1502
+ core_exceptions.ServiceUnavailable,
1503
+ ),
1504
+ deadline=20.0,
1505
+ ),
1506
+ default_timeout=20.0,
1507
+ client_info=client_info,
1508
+ ),
1509
+ self.get_node_pool: self._wrap_method(
1510
+ self.get_node_pool,
1511
+ default_retry=retries.AsyncRetry(
1512
+ initial=0.1,
1513
+ maximum=60.0,
1514
+ multiplier=1.3,
1515
+ predicate=retries.if_exception_type(
1516
+ core_exceptions.DeadlineExceeded,
1517
+ core_exceptions.ServiceUnavailable,
1518
+ ),
1519
+ deadline=20.0,
1520
+ ),
1521
+ default_timeout=20.0,
1522
+ client_info=client_info,
1523
+ ),
1524
+ self.create_node_pool: self._wrap_method(
1525
+ self.create_node_pool,
1526
+ default_timeout=45.0,
1527
+ client_info=client_info,
1528
+ ),
1529
+ self.delete_node_pool: self._wrap_method(
1530
+ self.delete_node_pool,
1531
+ default_retry=retries.AsyncRetry(
1532
+ initial=0.1,
1533
+ maximum=60.0,
1534
+ multiplier=1.3,
1535
+ predicate=retries.if_exception_type(
1536
+ core_exceptions.DeadlineExceeded,
1537
+ core_exceptions.ServiceUnavailable,
1538
+ ),
1539
+ deadline=20.0,
1540
+ ),
1541
+ default_timeout=20.0,
1542
+ client_info=client_info,
1543
+ ),
1544
+ self.complete_node_pool_upgrade: self._wrap_method(
1545
+ self.complete_node_pool_upgrade,
1546
+ default_timeout=None,
1547
+ client_info=client_info,
1548
+ ),
1549
+ self.rollback_node_pool_upgrade: self._wrap_method(
1550
+ self.rollback_node_pool_upgrade,
1551
+ default_timeout=45.0,
1552
+ client_info=client_info,
1553
+ ),
1554
+ self.set_node_pool_management: self._wrap_method(
1555
+ self.set_node_pool_management,
1556
+ default_timeout=45.0,
1557
+ client_info=client_info,
1558
+ ),
1559
+ self.set_labels: self._wrap_method(
1560
+ self.set_labels,
1561
+ default_timeout=45.0,
1562
+ client_info=client_info,
1563
+ ),
1564
+ self.set_legacy_abac: self._wrap_method(
1565
+ self.set_legacy_abac,
1566
+ default_timeout=45.0,
1567
+ client_info=client_info,
1568
+ ),
1569
+ self.start_ip_rotation: self._wrap_method(
1570
+ self.start_ip_rotation,
1571
+ default_timeout=45.0,
1572
+ client_info=client_info,
1573
+ ),
1574
+ self.complete_ip_rotation: self._wrap_method(
1575
+ self.complete_ip_rotation,
1576
+ default_timeout=45.0,
1577
+ client_info=client_info,
1578
+ ),
1579
+ self.set_node_pool_size: self._wrap_method(
1580
+ self.set_node_pool_size,
1581
+ default_timeout=45.0,
1582
+ client_info=client_info,
1583
+ ),
1584
+ self.set_network_policy: self._wrap_method(
1585
+ self.set_network_policy,
1586
+ default_timeout=45.0,
1587
+ client_info=client_info,
1588
+ ),
1589
+ self.set_maintenance_policy: self._wrap_method(
1590
+ self.set_maintenance_policy,
1591
+ default_timeout=45.0,
1592
+ client_info=client_info,
1593
+ ),
1594
+ self.list_usable_subnetworks: self._wrap_method(
1595
+ self.list_usable_subnetworks,
1596
+ default_timeout=None,
1597
+ client_info=client_info,
1598
+ ),
1599
+ self.check_autopilot_compatibility: self._wrap_method(
1600
+ self.check_autopilot_compatibility,
1601
+ default_timeout=None,
1602
+ client_info=client_info,
1603
+ ),
1604
+ }
1605
+
1606
+ def _wrap_method(self, func, *args, **kwargs):
1607
+ if self._wrap_with_kind: # pragma: NO COVER
1608
+ kwargs["kind"] = self.kind
1609
+ return gapic_v1.method_async.wrap_method(func, *args, **kwargs)
1610
+
1611
+ def close(self):
1612
+ return self._logged_channel.close()
1613
+
1614
+ @property
1615
+ def kind(self) -> str:
1616
+ return "grpc_asyncio"
1617
+
1618
+
1619
+ __all__ = ("ClusterManagerGrpcAsyncIOTransport",)