diff --git a/docs/container_v1/cluster_manager.rst b/docs/container_v1/cluster_manager.rst new file mode 100644 index 00000000..be77fd5e --- /dev/null +++ b/docs/container_v1/cluster_manager.rst @@ -0,0 +1,11 @@ +ClusterManager +-------------------------------- + +.. automodule:: google.cloud.container_v1.services.cluster_manager + :members: + :inherited-members: + + +.. automodule:: google.cloud.container_v1.services.cluster_manager.pagers + :members: + :inherited-members: diff --git a/docs/container_v1/services.rst b/docs/container_v1/services.rst index a23224df..faa067b2 100644 --- a/docs/container_v1/services.rst +++ b/docs/container_v1/services.rst @@ -1,6 +1,6 @@ Services for Google Container v1 API ==================================== +.. toctree:: + :maxdepth: 2 -.. automodule:: google.cloud.container_v1.services.cluster_manager - :members: - :inherited-members: + cluster_manager diff --git a/docs/container_v1/types.rst b/docs/container_v1/types.rst index 0767dd6e..b6bb3f63 100644 --- a/docs/container_v1/types.rst +++ b/docs/container_v1/types.rst @@ -3,4 +3,5 @@ Types for Google Container v1 API .. automodule:: google.cloud.container_v1.types :members: + :undoc-members: :show-inheritance: diff --git a/docs/container_v1beta1/cluster_manager.rst b/docs/container_v1beta1/cluster_manager.rst new file mode 100644 index 00000000..e27c2b30 --- /dev/null +++ b/docs/container_v1beta1/cluster_manager.rst @@ -0,0 +1,11 @@ +ClusterManager +-------------------------------- + +.. automodule:: google.cloud.container_v1beta1.services.cluster_manager + :members: + :inherited-members: + + +.. automodule:: google.cloud.container_v1beta1.services.cluster_manager.pagers + :members: + :inherited-members: diff --git a/docs/container_v1beta1/services.rst b/docs/container_v1beta1/services.rst index e4b6a994..18ed4869 100644 --- a/docs/container_v1beta1/services.rst +++ b/docs/container_v1beta1/services.rst @@ -1,6 +1,6 @@ Services for Google Container v1beta1 API ========================================= +.. toctree:: + :maxdepth: 2 -.. automodule:: google.cloud.container_v1beta1.services.cluster_manager - :members: - :inherited-members: + cluster_manager diff --git a/docs/container_v1beta1/types.rst b/docs/container_v1beta1/types.rst index 9dd46e91..54844ef0 100644 --- a/docs/container_v1beta1/types.rst +++ b/docs/container_v1beta1/types.rst @@ -3,4 +3,5 @@ Types for Google Container v1beta1 API .. automodule:: google.cloud.container_v1beta1.types :members: + :undoc-members: :show-inheritance: diff --git a/google/cloud/container_v1/services/cluster_manager/async_client.py b/google/cloud/container_v1/services/cluster_manager/async_client.py index 5825f4d9..bec7be80 100644 --- a/google/cloud/container_v1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1/services/cluster_manager/async_client.py @@ -73,7 +73,36 @@ class ClusterManagerAsyncClient: ClusterManagerClient.parse_common_location_path ) - from_service_account_file = ClusterManagerClient.from_service_account_file + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ClusterManagerAsyncClient: The constructed client. + """ + return ClusterManagerClient.from_service_account_info.__func__(ClusterManagerAsyncClient, info, *args, **kwargs) # type: ignore + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ClusterManagerAsyncClient: The constructed client. + """ + return ClusterManagerClient.from_service_account_file.__func__(ClusterManagerAsyncClient, filename, *args, **kwargs) # type: ignore + from_service_account_json = from_service_account_file @property @@ -152,7 +181,7 @@ async def list_clusters( specified zone or all zones. Args: - request (:class:`~.cluster_service.ListClustersRequest`): + request (:class:`google.cloud.container_v1.types.ListClustersRequest`): The request object. ListClustersRequest lists clusters. project_id (:class:`str`): Deprecated. The Google Developers Console `project ID or @@ -160,6 +189,7 @@ async def list_clusters( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -169,6 +199,7 @@ async def list_clusters( in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -177,6 +208,7 @@ async def list_clusters( will be listed. Specified in the format ``projects/*/locations/*``. Location "-" matches all zones and all regions. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -188,7 +220,7 @@ async def list_clusters( sent along with the request as metadata. Returns: - ~.cluster_service.ListClustersResponse: + google.cloud.container_v1.types.ListClustersResponse: ListClustersResponse is the result of ListClustersRequest. @@ -226,6 +258,7 @@ async def list_clusters( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -258,7 +291,7 @@ async def get_cluster( r"""Gets the details of a specific cluster. Args: - request (:class:`~.cluster_service.GetClusterRequest`): + request (:class:`google.cloud.container_v1.types.GetClusterRequest`): The request object. GetClusterRequest gets the settings of a cluster. project_id (:class:`str`): @@ -267,6 +300,7 @@ async def get_cluster( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -275,6 +309,7 @@ async def get_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -283,6 +318,7 @@ async def get_cluster( to retrieve. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -290,6 +326,7 @@ async def get_cluster( The name (project, location, cluster) of the cluster to retrieve. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -301,7 +338,7 @@ async def get_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Cluster: + google.cloud.container_v1.types.Cluster: A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. @@ -339,6 +376,7 @@ async def get_cluster( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -383,7 +421,7 @@ async def create_cluster( indicating which CIDR range the cluster is using. Args: - request (:class:`~.cluster_service.CreateClusterRequest`): + request (:class:`google.cloud.container_v1.types.CreateClusterRequest`): The request object. CreateClusterRequest creates a cluster. project_id (:class:`str`): @@ -392,6 +430,7 @@ async def create_cluster( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -400,12 +439,14 @@ async def create_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (:class:`~.cluster_service.Cluster`): + cluster (:class:`google.cloud.container_v1.types.Cluster`): Required. A `cluster resource `__ + This corresponds to the ``cluster`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -413,6 +454,7 @@ async def create_cluster( The parent (project and location) where the cluster will be created. Specified in the format ``projects/*/locations/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -424,7 +466,7 @@ async def create_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -491,7 +533,7 @@ async def update_cluster( r"""Updates the settings of a specific cluster. Args: - request (:class:`~.cluster_service.UpdateClusterRequest`): + request (:class:`google.cloud.container_v1.types.UpdateClusterRequest`): The request object. UpdateClusterRequest updates the settings of a cluster. project_id (:class:`str`): @@ -500,6 +542,7 @@ async def update_cluster( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -508,6 +551,7 @@ async def update_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -516,12 +560,14 @@ async def update_cluster( to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - update (:class:`~.cluster_service.ClusterUpdate`): + update (:class:`google.cloud.container_v1.types.ClusterUpdate`): Required. A description of the update. + This corresponds to the ``update`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -529,6 +575,7 @@ async def update_cluster( The name (project, location, cluster) of the cluster to update. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -540,7 +587,7 @@ async def update_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -605,7 +652,7 @@ async def update_node_pool( specified node pool. Args: - request (:class:`~.cluster_service.UpdateNodePoolRequest`): + request (:class:`google.cloud.container_v1.types.UpdateNodePoolRequest`): The request object. UpdateNodePoolRequests update a node pool's image and/or version. @@ -616,7 +663,7 @@ async def update_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -659,7 +706,7 @@ async def set_node_pool_autoscaling( pool. Args: - request (:class:`~.cluster_service.SetNodePoolAutoscalingRequest`): + request (:class:`google.cloud.container_v1.types.SetNodePoolAutoscalingRequest`): The request object. SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. @@ -670,7 +717,7 @@ async def set_node_pool_autoscaling( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -717,7 +764,7 @@ async def set_logging_service( r"""Sets the logging service for a specific cluster. Args: - request (:class:`~.cluster_service.SetLoggingServiceRequest`): + request (:class:`google.cloud.container_v1.types.SetLoggingServiceRequest`): The request object. SetLoggingServiceRequest sets the logging service of a cluster. project_id (:class:`str`): @@ -726,6 +773,7 @@ async def set_logging_service( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -734,6 +782,7 @@ async def set_logging_service( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -742,6 +791,7 @@ async def set_logging_service( to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -760,6 +810,7 @@ async def set_logging_service( string,\ ``logging.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``logging.googleapis.com`` for earlier versions. + This corresponds to the ``logging_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -767,6 +818,7 @@ async def set_logging_service( The name (project, location, cluster) of the cluster to set logging. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -778,7 +830,7 @@ async def set_logging_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -849,7 +901,7 @@ async def set_monitoring_service( r"""Sets the monitoring service for a specific cluster. Args: - request (:class:`~.cluster_service.SetMonitoringServiceRequest`): + request (:class:`google.cloud.container_v1.types.SetMonitoringServiceRequest`): The request object. SetMonitoringServiceRequest sets the monitoring service of a cluster. project_id (:class:`str`): @@ -858,6 +910,7 @@ async def set_monitoring_service( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -866,6 +919,7 @@ async def set_monitoring_service( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -874,6 +928,7 @@ async def set_monitoring_service( to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -894,6 +949,7 @@ async def set_monitoring_service( string,\ ``monitoring.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``monitoring.googleapis.com`` for earlier versions. + This corresponds to the ``monitoring_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -901,6 +957,7 @@ async def set_monitoring_service( The name (project, location, cluster) of the cluster to set monitoring. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -912,7 +969,7 @@ async def set_monitoring_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -983,7 +1040,7 @@ async def set_addons_config( r"""Sets the addons for a specific cluster. Args: - request (:class:`~.cluster_service.SetAddonsConfigRequest`): + request (:class:`google.cloud.container_v1.types.SetAddonsConfigRequest`): The request object. SetAddonsConfigRequest sets the addons associated with the cluster. project_id (:class:`str`): @@ -992,6 +1049,7 @@ async def set_addons_config( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1000,6 +1058,7 @@ async def set_addons_config( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1008,13 +1067,15 @@ async def set_addons_config( to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - addons_config (:class:`~.cluster_service.AddonsConfig`): + addons_config (:class:`google.cloud.container_v1.types.AddonsConfig`): Required. The desired configurations for the various addons available to run in the cluster. + This corresponds to the ``addons_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1022,6 +1083,7 @@ async def set_addons_config( The name (project, location, cluster) of the cluster to set addons. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1033,7 +1095,7 @@ async def set_addons_config( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1104,7 +1166,7 @@ async def set_locations( instead. Args: - request (:class:`~.cluster_service.SetLocationsRequest`): + request (:class:`google.cloud.container_v1.types.SetLocationsRequest`): The request object. SetLocationsRequest sets the locations of the cluster. project_id (:class:`str`): @@ -1113,6 +1175,7 @@ async def set_locations( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1121,6 +1184,7 @@ async def set_locations( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1129,6 +1193,7 @@ async def set_locations( to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1142,6 +1207,7 @@ async def set_locations( This list must always include the cluster's primary zone. + This corresponds to the ``locations`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1149,6 +1215,7 @@ async def set_locations( The name (project, location, cluster) of the cluster to set locations. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1160,7 +1227,7 @@ async def set_locations( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1230,7 +1297,7 @@ async def update_master( r"""Updates the master for a specific cluster. Args: - request (:class:`~.cluster_service.UpdateMasterRequest`): + request (:class:`google.cloud.container_v1.types.UpdateMasterRequest`): The request object. UpdateMasterRequest updates the master of the cluster. project_id (:class:`str`): @@ -1239,6 +1306,7 @@ async def update_master( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1247,6 +1315,7 @@ async def update_master( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1255,6 +1324,7 @@ async def update_master( to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1273,6 +1343,7 @@ async def update_master( "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the default Kubernetes version + This corresponds to the ``master_version`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1280,6 +1351,7 @@ async def update_master( The name (project, location, cluster) of the cluster to update. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1291,7 +1363,7 @@ async def update_master( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1358,7 +1430,7 @@ async def set_master_auth( password. Args: - request (:class:`~.cluster_service.SetMasterAuthRequest`): + request (:class:`google.cloud.container_v1.types.SetMasterAuthRequest`): The request object. SetMasterAuthRequest updates the admin password of a cluster. @@ -1369,7 +1441,7 @@ async def set_master_auth( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1424,7 +1496,7 @@ async def delete_cluster( initially created. Args: - request (:class:`~.cluster_service.DeleteClusterRequest`): + request (:class:`google.cloud.container_v1.types.DeleteClusterRequest`): The request object. DeleteClusterRequest deletes a cluster. project_id (:class:`str`): @@ -1433,6 +1505,7 @@ async def delete_cluster( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1441,6 +1514,7 @@ async def delete_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1449,6 +1523,7 @@ async def delete_cluster( to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1456,6 +1531,7 @@ async def delete_cluster( The name (project, location, cluster) of the cluster to delete. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1467,7 +1543,7 @@ async def delete_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1509,6 +1585,7 @@ async def delete_cluster( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1540,7 +1617,7 @@ async def list_operations( or all zones. Args: - request (:class:`~.cluster_service.ListOperationsRequest`): + request (:class:`google.cloud.container_v1.types.ListOperationsRequest`): The request object. ListOperationsRequest lists operations. project_id (:class:`str`): @@ -1549,6 +1626,7 @@ async def list_operations( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1558,6 +1636,7 @@ async def list_operations( to return operations for, or ``-`` for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1569,7 +1648,7 @@ async def list_operations( sent along with the request as metadata. Returns: - ~.cluster_service.ListOperationsResponse: + google.cloud.container_v1.types.ListOperationsResponse: ListOperationsResponse is the result of ListOperationsRequest. @@ -1605,6 +1684,7 @@ async def list_operations( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1637,7 +1717,7 @@ async def get_operation( r"""Gets the specified operation. Args: - request (:class:`~.cluster_service.GetOperationRequest`): + request (:class:`google.cloud.container_v1.types.GetOperationRequest`): The request object. GetOperationRequest gets a single operation. project_id (:class:`str`): @@ -1646,6 +1726,7 @@ async def get_operation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1654,6 +1735,7 @@ async def get_operation( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1661,6 +1743,7 @@ async def get_operation( Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1668,6 +1751,7 @@ async def get_operation( The name (project, location, operation id) of the operation to get. Specified in the format ``projects/*/locations/*/operations/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1679,7 +1763,7 @@ async def get_operation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1721,6 +1805,7 @@ async def get_operation( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1753,7 +1838,7 @@ async def cancel_operation( r"""Cancels the specified operation. Args: - request (:class:`~.cluster_service.CancelOperationRequest`): + request (:class:`google.cloud.container_v1.types.CancelOperationRequest`): The request object. CancelOperationRequest cancels a single operation. project_id (:class:`str`): @@ -1762,6 +1847,7 @@ async def cancel_operation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1770,6 +1856,7 @@ async def cancel_operation( `zone `__ in which the operation resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1777,6 +1864,7 @@ async def cancel_operation( Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1784,6 +1872,7 @@ async def cancel_operation( The name (project, location, operation id) of the operation to cancel. Specified in the format ``projects/*/locations/*/operations/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1852,7 +1941,7 @@ async def get_server_config( Kubernetes Engine service. Args: - request (:class:`~.cluster_service.GetServerConfigRequest`): + request (:class:`google.cloud.container_v1.types.GetServerConfigRequest`): The request object. Gets the current Kubernetes Engine service configuration. project_id (:class:`str`): @@ -1861,6 +1950,7 @@ async def get_server_config( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1869,12 +1959,14 @@ async def get_server_config( `zone `__ to return operations for. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. name (:class:`str`): The name (project and location) of the server config to get, specified in the format ``projects/*/locations/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1886,7 +1978,7 @@ async def get_server_config( sent along with the request as metadata. Returns: - ~.cluster_service.ServerConfig: + google.cloud.container_v1.types.ServerConfig: Kubernetes Engine service configuration. @@ -1924,6 +2016,7 @@ async def get_server_config( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1955,7 +2048,7 @@ async def get_json_web_keys( available for all clusters. Args: - request (:class:`~.cluster_service.GetJSONWebKeysRequest`): + request (:class:`google.cloud.container_v1.types.GetJSONWebKeysRequest`): The request object. GetJSONWebKeysRequest gets the public component of the keys used by the cluster to sign token requests. This will be the jwks_uri for the @@ -1969,7 +2062,7 @@ async def get_json_web_keys( sent along with the request as metadata. Returns: - ~.cluster_service.GetJSONWebKeysResponse: + google.cloud.container_v1.types.GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 @@ -2014,7 +2107,7 @@ async def list_node_pools( r"""Lists the node pools for a cluster. Args: - request (:class:`~.cluster_service.ListNodePoolsRequest`): + request (:class:`google.cloud.container_v1.types.ListNodePoolsRequest`): The request object. ListNodePoolsRequest lists the node pool(s) for a cluster. project_id (:class:`str`): @@ -2023,6 +2116,7 @@ async def list_node_pools( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2031,6 +2125,7 @@ async def list_node_pools( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2038,6 +2133,7 @@ async def list_node_pools( Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2045,6 +2141,7 @@ async def list_node_pools( The parent (project, location, cluster id) where the node pools will be listed. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2056,7 +2153,7 @@ async def list_node_pools( sent along with the request as metadata. Returns: - ~.cluster_service.ListNodePoolsResponse: + google.cloud.container_v1.types.ListNodePoolsResponse: ListNodePoolsResponse is the result of ListNodePoolsRequest. @@ -2096,6 +2193,7 @@ async def list_node_pools( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -2129,7 +2227,7 @@ async def get_node_pool( r"""Retrieves the requested node pool. Args: - request (:class:`~.cluster_service.GetNodePoolRequest`): + request (:class:`google.cloud.container_v1.types.GetNodePoolRequest`): The request object. GetNodePoolRequest retrieves a node pool for a cluster. project_id (:class:`str`): @@ -2138,6 +2236,7 @@ async def get_node_pool( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2146,6 +2245,7 @@ async def get_node_pool( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2153,6 +2253,7 @@ async def get_node_pool( Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2160,6 +2261,7 @@ async def get_node_pool( Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2167,6 +2269,7 @@ async def get_node_pool( The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2178,7 +2281,7 @@ async def get_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.NodePool: + google.cloud.container_v1.types.NodePool: NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. @@ -2228,6 +2331,7 @@ async def get_node_pool( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -2261,7 +2365,7 @@ async def create_node_pool( r"""Creates a node pool for a cluster. Args: - request (:class:`~.cluster_service.CreateNodePoolRequest`): + request (:class:`google.cloud.container_v1.types.CreateNodePoolRequest`): The request object. CreateNodePoolRequest creates a node pool for a cluster. project_id (:class:`str`): @@ -2270,6 +2374,7 @@ async def create_node_pool( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2278,6 +2383,7 @@ async def create_node_pool( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2285,10 +2391,11 @@ async def create_node_pool( Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool (:class:`~.cluster_service.NodePool`): + node_pool (:class:`google.cloud.container_v1.types.NodePool`): Required. The node pool to create. This corresponds to the ``node_pool`` field on the ``request`` instance; if ``request`` is provided, this @@ -2297,6 +2404,7 @@ async def create_node_pool( The parent (project, location, cluster id) where the node pool will be created. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2308,7 +2416,7 @@ async def create_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2377,7 +2485,7 @@ async def delete_node_pool( r"""Deletes a node pool from a cluster. Args: - request (:class:`~.cluster_service.DeleteNodePoolRequest`): + request (:class:`google.cloud.container_v1.types.DeleteNodePoolRequest`): The request object. DeleteNodePoolRequest deletes a node pool for a cluster. project_id (:class:`str`): @@ -2386,6 +2494,7 @@ async def delete_node_pool( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2394,6 +2503,7 @@ async def delete_node_pool( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2401,6 +2511,7 @@ async def delete_node_pool( Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2409,6 +2520,7 @@ async def delete_node_pool( to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2416,6 +2528,7 @@ async def delete_node_pool( The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2427,7 +2540,7 @@ async def delete_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2471,6 +2584,7 @@ async def delete_node_pool( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -2506,7 +2620,7 @@ async def rollback_node_pool_upgrade( successfully completed. Args: - request (:class:`~.cluster_service.RollbackNodePoolUpgradeRequest`): + request (:class:`google.cloud.container_v1.types.RollbackNodePoolUpgradeRequest`): The request object. RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed NodePool upgrade. This will be an no-op if the last upgrade @@ -2517,6 +2631,7 @@ async def rollback_node_pool_upgrade( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2525,6 +2640,7 @@ async def rollback_node_pool_upgrade( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2533,6 +2649,7 @@ async def rollback_node_pool_upgrade( to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2541,6 +2658,7 @@ async def rollback_node_pool_upgrade( to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2549,6 +2667,7 @@ async def rollback_node_pool_upgrade( the node poll to rollback upgrade. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2560,7 +2679,7 @@ async def rollback_node_pool_upgrade( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2624,7 +2743,7 @@ async def set_node_pool_management( r"""Sets the NodeManagement options for a node pool. Args: - request (:class:`~.cluster_service.SetNodePoolManagementRequest`): + request (:class:`google.cloud.container_v1.types.SetNodePoolManagementRequest`): The request object. SetNodePoolManagementRequest sets the node management properties of a node pool. @@ -2635,7 +2754,7 @@ async def set_node_pool_management( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2677,7 +2796,7 @@ async def set_labels( r"""Sets labels on a cluster. Args: - request (:class:`~.cluster_service.SetLabelsRequest`): + request (:class:`google.cloud.container_v1.types.SetLabelsRequest`): The request object. SetLabelsRequest sets the Google Cloud Platform labels on a Google Container Engine cluster, which will in turn set them for Google Compute @@ -2690,7 +2809,7 @@ async def set_labels( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2738,7 +2857,7 @@ async def set_legacy_abac( on a cluster. Args: - request (:class:`~.cluster_service.SetLegacyAbacRequest`): + request (:class:`google.cloud.container_v1.types.SetLegacyAbacRequest`): The request object. SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for a cluster. project_id (:class:`str`): @@ -2747,6 +2866,7 @@ async def set_legacy_abac( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2755,6 +2875,7 @@ async def set_legacy_abac( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2763,12 +2884,14 @@ async def set_legacy_abac( to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. enabled (:class:`bool`): Required. Whether ABAC authorization will be enabled in the cluster. + This corresponds to the ``enabled`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2776,6 +2899,7 @@ async def set_legacy_abac( The name (project, location, cluster id) of the cluster to set legacy abac. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2787,7 +2911,7 @@ async def set_legacy_abac( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2855,7 +2979,7 @@ async def start_ip_rotation( r"""Starts master IP rotation. Args: - request (:class:`~.cluster_service.StartIPRotationRequest`): + request (:class:`google.cloud.container_v1.types.StartIPRotationRequest`): The request object. StartIPRotationRequest creates a new IP for the cluster and then performs a node upgrade on each node pool to point to the new IP. @@ -2865,6 +2989,7 @@ async def start_ip_rotation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2873,6 +2998,7 @@ async def start_ip_rotation( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2880,6 +3006,7 @@ async def start_ip_rotation( Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2887,6 +3014,7 @@ async def start_ip_rotation( The name (project, location, cluster id) of the cluster to start IP rotation. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2898,7 +3026,7 @@ async def start_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2964,7 +3092,7 @@ async def complete_ip_rotation( r"""Completes master IP rotation. Args: - request (:class:`~.cluster_service.CompleteIPRotationRequest`): + request (:class:`google.cloud.container_v1.types.CompleteIPRotationRequest`): The request object. CompleteIPRotationRequest moves the cluster master back into single-IP mode. project_id (:class:`str`): @@ -2973,6 +3101,7 @@ async def complete_ip_rotation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2981,6 +3110,7 @@ async def complete_ip_rotation( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2988,6 +3118,7 @@ async def complete_ip_rotation( Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2995,6 +3126,7 @@ async def complete_ip_rotation( The name (project, location, cluster id) of the cluster to complete IP rotation. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3006,7 +3138,7 @@ async def complete_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3068,7 +3200,7 @@ async def set_node_pool_size( r"""Sets the size for a specific node pool. Args: - request (:class:`~.cluster_service.SetNodePoolSizeRequest`): + request (:class:`google.cloud.container_v1.types.SetNodePoolSizeRequest`): The request object. SetNodePoolSizeRequest sets the size a node pool. @@ -3079,7 +3211,7 @@ async def set_node_pool_size( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3126,7 +3258,7 @@ async def set_network_policy( r"""Enables or disables Network Policy for a cluster. Args: - request (:class:`~.cluster_service.SetNetworkPolicyRequest`): + request (:class:`google.cloud.container_v1.types.SetNetworkPolicyRequest`): The request object. SetNetworkPolicyRequest enables/disables network policy for a cluster. project_id (:class:`str`): @@ -3135,6 +3267,7 @@ async def set_network_policy( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3143,6 +3276,7 @@ async def set_network_policy( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3150,12 +3284,14 @@ async def set_network_policy( Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - network_policy (:class:`~.cluster_service.NetworkPolicy`): + network_policy (:class:`google.cloud.container_v1.types.NetworkPolicy`): Required. Configuration options for the NetworkPolicy feature. + This corresponds to the ``network_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3163,6 +3299,7 @@ async def set_network_policy( The name (project, location, cluster id) of the cluster to set networking policy. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3174,7 +3311,7 @@ async def set_network_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3243,13 +3380,14 @@ async def set_maintenance_policy( r"""Sets the maintenance policy for a cluster. Args: - request (:class:`~.cluster_service.SetMaintenancePolicyRequest`): + request (:class:`google.cloud.container_v1.types.SetMaintenancePolicyRequest`): The request object. SetMaintenancePolicyRequest sets the maintenance policy for a cluster. project_id (:class:`str`): Required. The Google Developers Console `project ID or project number `__. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3257,19 +3395,22 @@ async def set_maintenance_policy( Required. The name of the Google Compute Engine `zone `__ in which the cluster resides. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. cluster_id (:class:`str`): Required. The name of the cluster to update. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - maintenance_policy (:class:`~.cluster_service.MaintenancePolicy`): + maintenance_policy (:class:`google.cloud.container_v1.types.MaintenancePolicy`): Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy. + This corresponds to the ``maintenance_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3277,6 +3418,7 @@ async def set_maintenance_policy( The name (project, location, cluster id) of the cluster to set maintenance policy. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3288,7 +3430,7 @@ async def set_maintenance_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3355,7 +3497,7 @@ async def list_usable_subnetworks( clusters in a project. Args: - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (:class:`google.cloud.container_v1.types.ListUsableSubnetworksRequest`): The request object. ListUsableSubnetworksRequest requests the list of usable subnetworks available to a user for creating clusters. @@ -3367,7 +3509,7 @@ async def list_usable_subnetworks( sent along with the request as metadata. Returns: - ~.pagers.ListUsableSubnetworksAsyncPager: + google.cloud.container_v1.services.cluster_manager.pagers.ListUsableSubnetworksAsyncPager: ListUsableSubnetworksResponse is the response of ListUsableSubnetworksRequest. diff --git a/google/cloud/container_v1/services/cluster_manager/client.py b/google/cloud/container_v1/services/cluster_manager/client.py index ab4b7c16..9ff4d7a5 100644 --- a/google/cloud/container_v1/services/cluster_manager/client.py +++ b/google/cloud/container_v1/services/cluster_manager/client.py @@ -110,6 +110,22 @@ def _get_default_mtls_endpoint(api_endpoint): DEFAULT_ENDPOINT ) + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ClusterManagerClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials @@ -122,7 +138,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): kwargs: Additional arguments to pass to the constructor. Returns: - {@api.name}: The constructed client. + ClusterManagerClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_file(filename) kwargs["credentials"] = credentials @@ -214,10 +230,10 @@ def __init__( credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. - transport (Union[str, ~.ClusterManagerTransport]): The + transport (Union[str, ClusterManagerTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (client_options_lib.ClientOptions): Custom options for the + client_options (google.api_core.client_options.ClientOptions): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -253,21 +269,17 @@ def __init__( util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")) ) - ssl_credentials = None + client_cert_source_func = None is_mtls = False if use_client_cert: if client_options.client_cert_source: - import grpc # type: ignore - - cert, key = client_options.client_cert_source() - ssl_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) is_mtls = True + client_cert_source_func = client_options.client_cert_source else: - creds = SslCredentials() - is_mtls = creds.is_mtls - ssl_credentials = creds.ssl_credentials if is_mtls else None + is_mtls = mtls.has_default_client_cert_source() + client_cert_source_func = ( + mtls.default_client_cert_source() if is_mtls else None + ) # Figure out which api endpoint to use. if client_options.api_endpoint is not None: @@ -310,7 +322,7 @@ def __init__( credentials_file=client_options.credentials_file, host=api_endpoint, scopes=client_options.scopes, - ssl_channel_credentials=ssl_credentials, + client_cert_source_for_mtls=client_cert_source_func, quota_project_id=client_options.quota_project_id, client_info=client_info, ) @@ -330,31 +342,34 @@ def list_clusters( specified zone or all zones. Args: - request (:class:`~.cluster_service.ListClustersRequest`): + request (google.cloud.container_v1.types.ListClustersRequest): The request object. ListClustersRequest lists clusters. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - parent (:class:`str`): + parent (str): The parent (project and location) where the clusters will be listed. Specified in the format ``projects/*/locations/*``. Location "-" matches all zones and all regions. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -366,7 +381,7 @@ def list_clusters( sent along with the request as metadata. Returns: - ~.cluster_service.ListClustersResponse: + google.cloud.container_v1.types.ListClustersResponse: ListClustersResponse is the result of ListClustersRequest. @@ -429,38 +444,42 @@ def get_cluster( r"""Gets the details of a specific cluster. Args: - request (:class:`~.cluster_service.GetClusterRequest`): + request (google.cloud.container_v1.types.GetClusterRequest): The request object. GetClusterRequest gets the settings of a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to retrieve. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -472,7 +491,7 @@ def get_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Cluster: + google.cloud.container_v1.types.Cluster: A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. @@ -547,36 +566,40 @@ def create_cluster( indicating which CIDR range the cluster is using. Args: - request (:class:`~.cluster_service.CreateClusterRequest`): + request (google.cloud.container_v1.types.CreateClusterRequest): The request object. CreateClusterRequest creates a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (:class:`~.cluster_service.Cluster`): + cluster (google.cloud.container_v1.types.Cluster): Required. A `cluster resource `__ + This corresponds to the ``cluster`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - parent (:class:`str`): + parent (str): The parent (project and location) where the cluster will be created. Specified in the format ``projects/*/locations/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -588,7 +611,7 @@ def create_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -656,44 +679,49 @@ def update_cluster( r"""Updates the settings of a specific cluster. Args: - request (:class:`~.cluster_service.UpdateClusterRequest`): + request (google.cloud.container_v1.types.UpdateClusterRequest): The request object. UpdateClusterRequest updates the settings of a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - update (:class:`~.cluster_service.ClusterUpdate`): + update (google.cloud.container_v1.types.ClusterUpdate): Required. A description of the update. + This corresponds to the ``update`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to update. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -705,7 +733,7 @@ def update_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -771,7 +799,7 @@ def update_node_pool( specified node pool. Args: - request (:class:`~.cluster_service.UpdateNodePoolRequest`): + request (google.cloud.container_v1.types.UpdateNodePoolRequest): The request object. UpdateNodePoolRequests update a node pool's image and/or version. @@ -782,7 +810,7 @@ def update_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -826,7 +854,7 @@ def set_node_pool_autoscaling( pool. Args: - request (:class:`~.cluster_service.SetNodePoolAutoscalingRequest`): + request (google.cloud.container_v1.types.SetNodePoolAutoscalingRequest): The request object. SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. @@ -837,7 +865,7 @@ def set_node_pool_autoscaling( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -887,35 +915,38 @@ def set_logging_service( r"""Sets the logging service for a specific cluster. Args: - request (:class:`~.cluster_service.SetLoggingServiceRequest`): + request (google.cloud.container_v1.types.SetLoggingServiceRequest): The request object. SetLoggingServiceRequest sets the logging service of a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - logging_service (:class:`str`): + logging_service (str): Required. The logging service the cluster should use to write logs. Currently available options: @@ -930,13 +961,15 @@ def set_logging_service( string,\ ``logging.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``logging.googleapis.com`` for earlier versions. + This corresponds to the ``logging_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to set logging. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -948,7 +981,7 @@ def set_logging_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1020,35 +1053,38 @@ def set_monitoring_service( r"""Sets the monitoring service for a specific cluster. Args: - request (:class:`~.cluster_service.SetMonitoringServiceRequest`): + request (google.cloud.container_v1.types.SetMonitoringServiceRequest): The request object. SetMonitoringServiceRequest sets the monitoring service of a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - monitoring_service (:class:`str`): + monitoring_service (str): Required. The monitoring service the cluster should use to write metrics. Currently available options: @@ -1065,13 +1101,15 @@ def set_monitoring_service( string,\ ``monitoring.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``monitoring.googleapis.com`` for earlier versions. + This corresponds to the ``monitoring_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to set monitoring. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1083,7 +1121,7 @@ def set_monitoring_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1155,45 +1193,50 @@ def set_addons_config( r"""Sets the addons for a specific cluster. Args: - request (:class:`~.cluster_service.SetAddonsConfigRequest`): + request (google.cloud.container_v1.types.SetAddonsConfigRequest): The request object. SetAddonsConfigRequest sets the addons associated with the cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - addons_config (:class:`~.cluster_service.AddonsConfig`): + addons_config (google.cloud.container_v1.types.AddonsConfig): Required. The desired configurations for the various addons available to run in the cluster. + This corresponds to the ``addons_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to set addons. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1205,7 +1248,7 @@ def set_addons_config( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1277,35 +1320,38 @@ def set_locations( instead. Args: - request (:class:`~.cluster_service.SetLocationsRequest`): + request (google.cloud.container_v1.types.SetLocationsRequest): The request object. SetLocationsRequest sets the locations of the cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - locations (:class:`Sequence[str]`): + locations (Sequence[str]): Required. The desired list of Google Compute Engine `zones `__ in which the cluster's nodes should be located. Changing @@ -1315,13 +1361,15 @@ def set_locations( This list must always include the cluster's primary zone. + This corresponds to the ``locations`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to set locations. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1333,7 +1381,7 @@ def set_locations( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1366,12 +1414,11 @@ def set_locations( request.zone = zone if cluster_id is not None: request.cluster_id = cluster_id + if locations is not None: + request.locations = locations if name is not None: request.name = name - if locations: - request.locations.extend(locations) - # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.set_locations] @@ -1404,35 +1451,38 @@ def update_master( r"""Updates the master for a specific cluster. Args: - request (:class:`~.cluster_service.UpdateMasterRequest`): + request (google.cloud.container_v1.types.UpdateMasterRequest): The request object. UpdateMasterRequest updates the master of the cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - master_version (:class:`str`): + master_version (str): Required. The Kubernetes version to change the master to. Users may specify either explicit @@ -1447,13 +1497,15 @@ def update_master( "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the default Kubernetes version + This corresponds to the ``master_version`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to update. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1465,7 +1517,7 @@ def update_master( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1533,7 +1585,7 @@ def set_master_auth( password. Args: - request (:class:`~.cluster_service.SetMasterAuthRequest`): + request (google.cloud.container_v1.types.SetMasterAuthRequest): The request object. SetMasterAuthRequest updates the admin password of a cluster. @@ -1544,7 +1596,7 @@ def set_master_auth( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1600,38 +1652,42 @@ def delete_cluster( initially created. Args: - request (:class:`~.cluster_service.DeleteClusterRequest`): + request (google.cloud.container_v1.types.DeleteClusterRequest): The request object. DeleteClusterRequest deletes a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster) of the cluster to delete. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1643,7 +1699,7 @@ def delete_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1709,24 +1765,26 @@ def list_operations( or all zones. Args: - request (:class:`~.cluster_service.ListOperationsRequest`): + request (google.cloud.container_v1.types.ListOperationsRequest): The request object. ListOperationsRequest lists operations. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ to return operations for, or ``-`` for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1738,7 +1796,7 @@ def list_operations( sent along with the request as metadata. Returns: - ~.cluster_service.ListOperationsResponse: + google.cloud.container_v1.types.ListOperationsResponse: ListOperationsResponse is the result of ListOperationsRequest. @@ -1799,37 +1857,41 @@ def get_operation( r"""Gets the specified operation. Args: - request (:class:`~.cluster_service.GetOperationRequest`): + request (google.cloud.container_v1.types.GetOperationRequest): The request object. GetOperationRequest gets a single operation. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - operation_id (:class:`str`): + operation_id (str): Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, operation id) of the operation to get. Specified in the format ``projects/*/locations/*/operations/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1841,7 +1903,7 @@ def get_operation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1908,37 +1970,41 @@ def cancel_operation( r"""Cancels the specified operation. Args: - request (:class:`~.cluster_service.CancelOperationRequest`): + request (google.cloud.container_v1.types.CancelOperationRequest): The request object. CancelOperationRequest cancels a single operation. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the operation resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - operation_id (:class:`str`): + operation_id (str): Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, operation id) of the operation to cancel. Specified in the format ``projects/*/locations/*/operations/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2008,29 +2074,32 @@ def get_server_config( Kubernetes Engine service. Args: - request (:class:`~.cluster_service.GetServerConfigRequest`): + request (google.cloud.container_v1.types.GetServerConfigRequest): The request object. Gets the current Kubernetes Engine service configuration. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ to return operations for. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project and location) of the server config to get, specified in the format ``projects/*/locations/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2042,7 +2111,7 @@ def get_server_config( sent along with the request as metadata. Returns: - ~.cluster_service.ServerConfig: + google.cloud.container_v1.types.ServerConfig: Kubernetes Engine service configuration. @@ -2104,7 +2173,7 @@ def get_json_web_keys( available for all clusters. Args: - request (:class:`~.cluster_service.GetJSONWebKeysRequest`): + request (google.cloud.container_v1.types.GetJSONWebKeysRequest): The request object. GetJSONWebKeysRequest gets the public component of the keys used by the cluster to sign token requests. This will be the jwks_uri for the @@ -2118,7 +2187,7 @@ def get_json_web_keys( sent along with the request as metadata. Returns: - ~.cluster_service.GetJSONWebKeysResponse: + google.cloud.container_v1.types.GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 @@ -2164,37 +2233,41 @@ def list_node_pools( r"""Lists the node pools for a cluster. Args: - request (:class:`~.cluster_service.ListNodePoolsRequest`): + request (google.cloud.container_v1.types.ListNodePoolsRequest): The request object. ListNodePoolsRequest lists the node pool(s) for a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - parent (:class:`str`): + parent (str): The parent (project, location, cluster id) where the node pools will be listed. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2206,7 +2279,7 @@ def list_node_pools( sent along with the request as metadata. Returns: - ~.cluster_service.ListNodePoolsResponse: + google.cloud.container_v1.types.ListNodePoolsResponse: ListNodePoolsResponse is the result of ListNodePoolsRequest. @@ -2272,44 +2345,49 @@ def get_node_pool( r"""Retrieves the requested node pool. Args: - request (:class:`~.cluster_service.GetNodePoolRequest`): + request (google.cloud.container_v1.types.GetNodePoolRequest): The request object. GetNodePoolRequest retrieves a node pool for a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster, node pool id) of the node pool to get. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2321,7 +2399,7 @@ def get_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.NodePool: + google.cloud.container_v1.types.NodePool: NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. @@ -2397,42 +2475,46 @@ def create_node_pool( r"""Creates a node pool for a cluster. Args: - request (:class:`~.cluster_service.CreateNodePoolRequest`): + request (google.cloud.container_v1.types.CreateNodePoolRequest): The request object. CreateNodePoolRequest creates a node pool for a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool (:class:`~.cluster_service.NodePool`): + node_pool (google.cloud.container_v1.types.NodePool): Required. The node pool to create. This corresponds to the ``node_pool`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - parent (:class:`str`): + parent (str): The parent (project, location, cluster id) where the node pool will be created. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2444,7 +2526,7 @@ def create_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2514,45 +2596,50 @@ def delete_node_pool( r"""Deletes a node pool from a cluster. Args: - request (:class:`~.cluster_service.DeleteNodePoolRequest`): + request (google.cloud.container_v1.types.DeleteNodePoolRequest): The request object. DeleteNodePoolRequest deletes a node pool for a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster, node pool id) of the node pool to delete. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2564,7 +2651,7 @@ def delete_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2636,49 +2723,54 @@ def rollback_node_pool_upgrade( successfully completed. Args: - request (:class:`~.cluster_service.RollbackNodePoolUpgradeRequest`): + request (google.cloud.container_v1.types.RollbackNodePoolUpgradeRequest): The request object. RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed NodePool upgrade. This will be an no-op if the last upgrade successfully completed. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster, node pool id) of the node poll to rollback upgrade. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2690,7 +2782,7 @@ def rollback_node_pool_upgrade( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2757,7 +2849,7 @@ def set_node_pool_management( r"""Sets the NodeManagement options for a node pool. Args: - request (:class:`~.cluster_service.SetNodePoolManagementRequest`): + request (google.cloud.container_v1.types.SetNodePoolManagementRequest): The request object. SetNodePoolManagementRequest sets the node management properties of a node pool. @@ -2768,7 +2860,7 @@ def set_node_pool_management( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2811,7 +2903,7 @@ def set_labels( r"""Sets labels on a cluster. Args: - request (:class:`~.cluster_service.SetLabelsRequest`): + request (google.cloud.container_v1.types.SetLabelsRequest): The request object. SetLabelsRequest sets the Google Cloud Platform labels on a Google Container Engine cluster, which will in turn set them for Google Compute @@ -2824,7 +2916,7 @@ def set_labels( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2873,44 +2965,49 @@ def set_legacy_abac( on a cluster. Args: - request (:class:`~.cluster_service.SetLegacyAbacRequest`): + request (google.cloud.container_v1.types.SetLegacyAbacRequest): The request object. SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - enabled (:class:`bool`): + enabled (bool): Required. Whether ABAC authorization will be enabled in the cluster. + This corresponds to the ``enabled`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster id) of the cluster to set legacy abac. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2922,7 +3019,7 @@ def set_legacy_abac( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2991,38 +3088,42 @@ def start_ip_rotation( r"""Starts master IP rotation. Args: - request (:class:`~.cluster_service.StartIPRotationRequest`): + request (google.cloud.container_v1.types.StartIPRotationRequest): The request object. StartIPRotationRequest creates a new IP for the cluster and then performs a node upgrade on each node pool to point to the new IP. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster id) of the cluster to start IP rotation. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3034,7 +3135,7 @@ def start_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3101,37 +3202,41 @@ def complete_ip_rotation( r"""Completes master IP rotation. Args: - request (:class:`~.cluster_service.CompleteIPRotationRequest`): + request (google.cloud.container_v1.types.CompleteIPRotationRequest): The request object. CompleteIPRotationRequest moves the cluster master back into single-IP mode. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster id) of the cluster to complete IP rotation. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3143,7 +3248,7 @@ def complete_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3206,7 +3311,7 @@ def set_node_pool_size( r"""Sets the size for a specific node pool. Args: - request (:class:`~.cluster_service.SetNodePoolSizeRequest`): + request (google.cloud.container_v1.types.SetNodePoolSizeRequest): The request object. SetNodePoolSizeRequest sets the size a node pool. @@ -3217,7 +3322,7 @@ def set_node_pool_size( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3265,43 +3370,48 @@ def set_network_policy( r"""Enables or disables Network Policy for a cluster. Args: - request (:class:`~.cluster_service.SetNetworkPolicyRequest`): + request (google.cloud.container_v1.types.SetNetworkPolicyRequest): The request object. SetNetworkPolicyRequest enables/disables network policy for a cluster. - project_id (:class:`str`): + project_id (str): Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - network_policy (:class:`~.cluster_service.NetworkPolicy`): + network_policy (google.cloud.container_v1.types.NetworkPolicy): Required. Configuration options for the NetworkPolicy feature. + This corresponds to the ``network_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster id) of the cluster to set networking policy. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3313,7 +3423,7 @@ def set_network_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3383,40 +3493,45 @@ def set_maintenance_policy( r"""Sets the maintenance policy for a cluster. Args: - request (:class:`~.cluster_service.SetMaintenancePolicyRequest`): + request (google.cloud.container_v1.types.SetMaintenancePolicyRequest): The request object. SetMaintenancePolicyRequest sets the maintenance policy for a cluster. - project_id (:class:`str`): + project_id (str): Required. The Google Developers Console `project ID or project number `__. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. The name of the Google Compute Engine `zone `__ in which the cluster resides. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. The name of the cluster to update. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - maintenance_policy (:class:`~.cluster_service.MaintenancePolicy`): + maintenance_policy (google.cloud.container_v1.types.MaintenancePolicy): Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy. + This corresponds to the ``maintenance_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - name (:class:`str`): + name (str): The name (project, location, cluster id) of the cluster to set maintenance policy. Specified in the format ``projects/*/locations/*/clusters/*``. + This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3428,7 +3543,7 @@ def set_maintenance_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3496,7 +3611,7 @@ def list_usable_subnetworks( clusters in a project. Args: - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (google.cloud.container_v1.types.ListUsableSubnetworksRequest): The request object. ListUsableSubnetworksRequest requests the list of usable subnetworks available to a user for creating clusters. @@ -3508,7 +3623,7 @@ def list_usable_subnetworks( sent along with the request as metadata. Returns: - ~.pagers.ListUsableSubnetworksPager: + google.cloud.container_v1.services.cluster_manager.pagers.ListUsableSubnetworksPager: ListUsableSubnetworksResponse is the response of ListUsableSubnetworksRequest. diff --git a/google/cloud/container_v1/services/cluster_manager/pagers.py b/google/cloud/container_v1/services/cluster_manager/pagers.py index 8491351b..e2a2aac9 100644 --- a/google/cloud/container_v1/services/cluster_manager/pagers.py +++ b/google/cloud/container_v1/services/cluster_manager/pagers.py @@ -15,7 +15,16 @@ # limitations under the License. # -from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple +from typing import ( + Any, + AsyncIterable, + Awaitable, + Callable, + Iterable, + Sequence, + Tuple, + Optional, +) from google.cloud.container_v1.types import cluster_service @@ -24,7 +33,7 @@ class ListUsableSubnetworksPager: """A pager for iterating through ``list_usable_subnetworks`` requests. This class thinly wraps an initial - :class:`~.cluster_service.ListUsableSubnetworksResponse` object, and + :class:`google.cloud.container_v1.types.ListUsableSubnetworksResponse` object, and provides an ``__iter__`` method to iterate through its ``subnetworks`` field. @@ -33,7 +42,7 @@ class ListUsableSubnetworksPager: through the ``subnetworks`` field on the corresponding responses. - All the usual :class:`~.cluster_service.ListUsableSubnetworksResponse` + All the usual :class:`google.cloud.container_v1.types.ListUsableSubnetworksResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -51,9 +60,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (google.cloud.container_v1.types.ListUsableSubnetworksRequest): The initial request object. - response (:class:`~.cluster_service.ListUsableSubnetworksResponse`): + response (google.cloud.container_v1.types.ListUsableSubnetworksResponse): The initial response object. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. @@ -86,7 +95,7 @@ class ListUsableSubnetworksAsyncPager: """A pager for iterating through ``list_usable_subnetworks`` requests. This class thinly wraps an initial - :class:`~.cluster_service.ListUsableSubnetworksResponse` object, and + :class:`google.cloud.container_v1.types.ListUsableSubnetworksResponse` object, and provides an ``__aiter__`` method to iterate through its ``subnetworks`` field. @@ -95,7 +104,7 @@ class ListUsableSubnetworksAsyncPager: through the ``subnetworks`` field on the corresponding responses. - All the usual :class:`~.cluster_service.ListUsableSubnetworksResponse` + All the usual :class:`google.cloud.container_v1.types.ListUsableSubnetworksResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -113,9 +122,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (google.cloud.container_v1.types.ListUsableSubnetworksRequest): The initial request object. - response (:class:`~.cluster_service.ListUsableSubnetworksResponse`): + response (google.cloud.container_v1.types.ListUsableSubnetworksResponse): The initial response object. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. diff --git a/google/cloud/container_v1/services/cluster_manager/transports/base.py b/google/cloud/container_v1/services/cluster_manager/transports/base.py index 9f79bd3f..e237c85d 100644 --- a/google/cloud/container_v1/services/cluster_manager/transports/base.py +++ b/google/cloud/container_v1/services/cluster_manager/transports/base.py @@ -68,10 +68,10 @@ def __init__( scope (Optional[Sequence[str]]): A list of scopes. quota_project_id (Optional[str]): An optional project to use for billing and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. """ # Save the hostname. Default to port 443 (HTTPS) if none is specified. @@ -79,6 +79,9 @@ def __init__( host += ":443" self._host = host + # Save the scopes. + self._scopes = scopes or self.AUTH_SCOPES + # If no credentials are provided, then determine the appropriate # defaults. if credentials and credentials_file: @@ -88,20 +91,17 @@ def __init__( if credentials_file is not None: credentials, _ = auth.load_credentials_from_file( - credentials_file, scopes=scopes, quota_project_id=quota_project_id + credentials_file, scopes=self._scopes, quota_project_id=quota_project_id ) elif credentials is None: credentials, _ = auth.default( - scopes=scopes, quota_project_id=quota_project_id + scopes=self._scopes, quota_project_id=quota_project_id ) # Save the credentials. self._credentials = credentials - # Lifted into its own function so it can be stubbed out during tests. - self._prep_wrapped_messages(client_info) - def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { @@ -114,6 +114,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -127,6 +128,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -174,6 +176,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -187,6 +190,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -200,6 +204,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -216,6 +221,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -232,6 +238,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -245,6 +252,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -261,6 +269,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, diff --git a/google/cloud/container_v1/services/cluster_manager/transports/grpc.py b/google/cloud/container_v1/services/cluster_manager/transports/grpc.py index bf669fd8..c33ecaf6 100644 --- a/google/cloud/container_v1/services/cluster_manager/transports/grpc.py +++ b/google/cloud/container_v1/services/cluster_manager/transports/grpc.py @@ -58,6 +58,7 @@ def __init__( api_mtls_endpoint: str = None, client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: @@ -88,6 +89,10 @@ def __init__( ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials for grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. client_info (google.api_core.gapic_v1.client_info.ClientInfo): @@ -102,72 +107,60 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) if channel: - # Sanity check: Ensure that channel and credentials are not both - # provided. + # Ignore credentials if a channel was passed. credentials = False - # If a channel was explicitly provided, set it. self._grpc_channel = channel self._ssl_channel_credentials = None - elif api_mtls_endpoint: - warnings.warn( - "api_mtls_endpoint and client_cert_source are deprecated", - DeprecationWarning, - ) - host = ( - api_mtls_endpoint - if ":" in api_mtls_endpoint - else api_mtls_endpoint + ":443" - ) + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) - - # Create SSL credentials with client_cert_source or application - # default SSL credentials. - if client_cert_source: - cert, key = client_cert_source() - ssl_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) else: - ssl_credentials = SslCredentials().ssl_credentials - - # create a new channel. The provided one is ignored. - self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, - credentials_file=credentials_file, - ssl_credentials=ssl_credentials, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - self._ssl_channel_credentials = ssl_credentials - else: - host = host if ":" in host else host + ":443" + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + ) - # create a new channel. The provided one is ignored. + if not self._grpc_channel: self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, + self._host, + credentials=self._credentials, credentials_file=credentials_file, - ssl_credentials=ssl_channel_credentials, - scopes=scopes or self.AUTH_SCOPES, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, options=[ ("grpc.max_send_message_length", -1), @@ -175,17 +168,8 @@ def __init__( ], ) - self._stubs = {} # type: Dict[str, Callable] - - # Run the base constructor. - super().__init__( - host=host, - credentials=credentials, - credentials_file=credentials_file, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - client_info=client_info, - ) + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) @classmethod def create_channel( @@ -199,7 +183,7 @@ def create_channel( ) -> grpc.Channel: """Create and return a gRPC channel object. Args: - address (Optional[str]): The host for the channel to use. + host (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If diff --git a/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py b/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py index 8f38cdd2..385c0e06 100644 --- a/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py +++ b/google/cloud/container_v1/services/cluster_manager/transports/grpc_asyncio.py @@ -62,7 +62,7 @@ def create_channel( ) -> aio.Channel: """Create and return a gRPC AsyncIO channel object. Args: - address (Optional[str]): The host for the channel to use. + host (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If @@ -102,6 +102,7 @@ def __init__( api_mtls_endpoint: str = None, client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, quota_project_id=None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: @@ -133,12 +134,16 @@ def __init__( ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials for grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. Raises: @@ -147,72 +152,60 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) if channel: - # Sanity check: Ensure that channel and credentials are not both - # provided. + # Ignore credentials if a channel was passed. credentials = False - # If a channel was explicitly provided, set it. self._grpc_channel = channel self._ssl_channel_credentials = None - elif api_mtls_endpoint: - warnings.warn( - "api_mtls_endpoint and client_cert_source are deprecated", - DeprecationWarning, - ) - host = ( - api_mtls_endpoint - if ":" in api_mtls_endpoint - else api_mtls_endpoint + ":443" - ) + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) - - # Create SSL credentials with client_cert_source or application - # default SSL credentials. - if client_cert_source: - cert, key = client_cert_source() - ssl_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) else: - ssl_credentials = SslCredentials().ssl_credentials - - # create a new channel. The provided one is ignored. - self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, - credentials_file=credentials_file, - ssl_credentials=ssl_credentials, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - self._ssl_channel_credentials = ssl_credentials - else: - host = host if ":" in host else host + ":443" + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + ) - # create a new channel. The provided one is ignored. + if not self._grpc_channel: self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, + self._host, + credentials=self._credentials, credentials_file=credentials_file, - ssl_credentials=ssl_channel_credentials, - scopes=scopes or self.AUTH_SCOPES, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, options=[ ("grpc.max_send_message_length", -1), @@ -220,17 +213,8 @@ def __init__( ], ) - # Run the base constructor. - super().__init__( - host=host, - credentials=credentials, - credentials_file=credentials_file, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - client_info=client_info, - ) - - self._stubs = {} + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) @property def grpc_channel(self) -> aio.Channel: diff --git a/google/cloud/container_v1/types/__init__.py b/google/cloud/container_v1/types/__init__.py index 2f25cd40..a20fef06 100644 --- a/google/cloud/container_v1/types/__init__.py +++ b/google/cloud/container_v1/types/__init__.py @@ -16,197 +16,197 @@ # from .cluster_service import ( - NodeConfig, - ShieldedInstanceConfig, - SandboxConfig, - ReservationAffinity, - NodeTaint, - MasterAuth, - ClientCertificateConfig, + AcceleratorConfig, AddonsConfig, - HttpLoadBalancing, - HorizontalPodAutoscaling, - KubernetesDashboard, - NetworkPolicyConfig, - DnsCacheConfig, - PrivateClusterMasterGlobalAccessConfig, - PrivateClusterConfig, AuthenticatorGroupsConfig, - CloudRunConfig, - ConfigConnectorConfig, - MasterAuthorizedNetworksConfig, - LegacyAbac, - NetworkPolicy, + AutoprovisioningNodePoolDefaults, + AutoUpgradeOptions, BinaryAuthorization, - IPAllocationPolicy, + CancelOperationRequest, + ClientCertificateConfig, + CloudRunConfig, Cluster, + ClusterAutoscaling, ClusterUpdate, - Operation, - OperationProgress, + CompleteIPRotationRequest, + ConfigConnectorConfig, CreateClusterRequest, - GetClusterRequest, - UpdateClusterRequest, - UpdateNodePoolRequest, - SetNodePoolAutoscalingRequest, - SetLoggingServiceRequest, - SetMonitoringServiceRequest, - SetAddonsConfigRequest, - SetLocationsRequest, - UpdateMasterRequest, - SetMasterAuthRequest, + CreateNodePoolRequest, + DailyMaintenanceWindow, + DatabaseEncryption, + DefaultSnatStatus, DeleteClusterRequest, + DeleteNodePoolRequest, + DnsCacheConfig, + GetClusterRequest, + GetJSONWebKeysRequest, + GetJSONWebKeysResponse, + GetNodePoolRequest, + GetOpenIDConfigRequest, + GetOpenIDConfigResponse, + GetOperationRequest, + GetServerConfigRequest, + HorizontalPodAutoscaling, + HttpLoadBalancing, + IntraNodeVisibilityConfig, + IPAllocationPolicy, + Jwk, + KubernetesDashboard, + LegacyAbac, ListClustersRequest, ListClustersResponse, - GetOperationRequest, + ListNodePoolsRequest, + ListNodePoolsResponse, ListOperationsRequest, - CancelOperationRequest, ListOperationsResponse, - GetServerConfigRequest, - ServerConfig, - CreateNodePoolRequest, - DeleteNodePoolRequest, - ListNodePoolsRequest, - GetNodePoolRequest, - NodePool, - NodeManagement, - AutoUpgradeOptions, + ListUsableSubnetworksRequest, + ListUsableSubnetworksResponse, MaintenancePolicy, MaintenanceWindow, - TimeWindow, + MasterAuth, + MasterAuthorizedNetworksConfig, + MaxPodsConstraint, + NetworkConfig, + NetworkPolicy, + NetworkPolicyConfig, + NodeConfig, + NodeManagement, + NodePool, + NodePoolAutoscaling, + NodeTaint, + Operation, + OperationProgress, + PrivateClusterConfig, + PrivateClusterMasterGlobalAccessConfig, RecurringTimeWindow, - DailyMaintenanceWindow, - SetNodePoolManagementRequest, - SetNodePoolSizeRequest, - RollbackNodePoolUpgradeRequest, - ListNodePoolsResponse, - ClusterAutoscaling, - AutoprovisioningNodePoolDefaults, + ReleaseChannel, + ReservationAffinity, ResourceLimit, - NodePoolAutoscaling, + ResourceUsageExportConfig, + RollbackNodePoolUpgradeRequest, + SandboxConfig, + ServerConfig, + SetAddonsConfigRequest, SetLabelsRequest, SetLegacyAbacRequest, - StartIPRotationRequest, - CompleteIPRotationRequest, - AcceleratorConfig, - WorkloadMetadataConfig, - SetNetworkPolicyRequest, + SetLocationsRequest, + SetLoggingServiceRequest, SetMaintenancePolicyRequest, + SetMasterAuthRequest, + SetMonitoringServiceRequest, + SetNetworkPolicyRequest, + SetNodePoolAutoscalingRequest, + SetNodePoolManagementRequest, + SetNodePoolSizeRequest, + ShieldedInstanceConfig, + ShieldedNodes, + StartIPRotationRequest, StatusCondition, - NetworkConfig, - GetOpenIDConfigRequest, - GetOpenIDConfigResponse, - GetJSONWebKeysRequest, - Jwk, - GetJSONWebKeysResponse, - ReleaseChannel, - IntraNodeVisibilityConfig, - MaxPodsConstraint, - WorkloadIdentityConfig, - DatabaseEncryption, - ListUsableSubnetworksRequest, - ListUsableSubnetworksResponse, - UsableSubnetworkSecondaryRange, + TimeWindow, + UpdateClusterRequest, + UpdateMasterRequest, + UpdateNodePoolRequest, UsableSubnetwork, - ResourceUsageExportConfig, + UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, - DefaultSnatStatus, - ShieldedNodes, + WorkloadIdentityConfig, + WorkloadMetadataConfig, ) __all__ = ( - "NodeConfig", - "ShieldedInstanceConfig", - "SandboxConfig", - "ReservationAffinity", - "NodeTaint", - "MasterAuth", - "ClientCertificateConfig", + "AcceleratorConfig", "AddonsConfig", - "HttpLoadBalancing", - "HorizontalPodAutoscaling", - "KubernetesDashboard", - "NetworkPolicyConfig", - "DnsCacheConfig", - "PrivateClusterMasterGlobalAccessConfig", - "PrivateClusterConfig", "AuthenticatorGroupsConfig", - "CloudRunConfig", - "ConfigConnectorConfig", - "MasterAuthorizedNetworksConfig", - "LegacyAbac", - "NetworkPolicy", + "AutoprovisioningNodePoolDefaults", + "AutoUpgradeOptions", "BinaryAuthorization", - "IPAllocationPolicy", + "CancelOperationRequest", + "ClientCertificateConfig", + "CloudRunConfig", "Cluster", + "ClusterAutoscaling", "ClusterUpdate", - "Operation", - "OperationProgress", + "CompleteIPRotationRequest", + "ConfigConnectorConfig", "CreateClusterRequest", - "GetClusterRequest", - "UpdateClusterRequest", - "UpdateNodePoolRequest", - "SetNodePoolAutoscalingRequest", - "SetLoggingServiceRequest", - "SetMonitoringServiceRequest", - "SetAddonsConfigRequest", - "SetLocationsRequest", - "UpdateMasterRequest", - "SetMasterAuthRequest", + "CreateNodePoolRequest", + "DailyMaintenanceWindow", + "DatabaseEncryption", + "DefaultSnatStatus", "DeleteClusterRequest", + "DeleteNodePoolRequest", + "DnsCacheConfig", + "GetClusterRequest", + "GetJSONWebKeysRequest", + "GetJSONWebKeysResponse", + "GetNodePoolRequest", + "GetOpenIDConfigRequest", + "GetOpenIDConfigResponse", + "GetOperationRequest", + "GetServerConfigRequest", + "HorizontalPodAutoscaling", + "HttpLoadBalancing", + "IntraNodeVisibilityConfig", + "IPAllocationPolicy", + "Jwk", + "KubernetesDashboard", + "LegacyAbac", "ListClustersRequest", "ListClustersResponse", - "GetOperationRequest", + "ListNodePoolsRequest", + "ListNodePoolsResponse", "ListOperationsRequest", - "CancelOperationRequest", "ListOperationsResponse", - "GetServerConfigRequest", - "ServerConfig", - "CreateNodePoolRequest", - "DeleteNodePoolRequest", - "ListNodePoolsRequest", - "GetNodePoolRequest", - "NodePool", - "NodeManagement", - "AutoUpgradeOptions", + "ListUsableSubnetworksRequest", + "ListUsableSubnetworksResponse", "MaintenancePolicy", "MaintenanceWindow", - "TimeWindow", + "MasterAuth", + "MasterAuthorizedNetworksConfig", + "MaxPodsConstraint", + "NetworkConfig", + "NetworkPolicy", + "NetworkPolicyConfig", + "NodeConfig", + "NodeManagement", + "NodePool", + "NodePoolAutoscaling", + "NodeTaint", + "Operation", + "OperationProgress", + "PrivateClusterConfig", + "PrivateClusterMasterGlobalAccessConfig", "RecurringTimeWindow", - "DailyMaintenanceWindow", - "SetNodePoolManagementRequest", - "SetNodePoolSizeRequest", - "RollbackNodePoolUpgradeRequest", - "ListNodePoolsResponse", - "ClusterAutoscaling", - "AutoprovisioningNodePoolDefaults", + "ReleaseChannel", + "ReservationAffinity", "ResourceLimit", - "NodePoolAutoscaling", + "ResourceUsageExportConfig", + "RollbackNodePoolUpgradeRequest", + "SandboxConfig", + "ServerConfig", + "SetAddonsConfigRequest", "SetLabelsRequest", "SetLegacyAbacRequest", - "StartIPRotationRequest", - "CompleteIPRotationRequest", - "AcceleratorConfig", - "WorkloadMetadataConfig", - "SetNetworkPolicyRequest", + "SetLocationsRequest", + "SetLoggingServiceRequest", "SetMaintenancePolicyRequest", + "SetMasterAuthRequest", + "SetMonitoringServiceRequest", + "SetNetworkPolicyRequest", + "SetNodePoolAutoscalingRequest", + "SetNodePoolManagementRequest", + "SetNodePoolSizeRequest", + "ShieldedInstanceConfig", + "ShieldedNodes", + "StartIPRotationRequest", "StatusCondition", - "NetworkConfig", - "GetOpenIDConfigRequest", - "GetOpenIDConfigResponse", - "GetJSONWebKeysRequest", - "Jwk", - "GetJSONWebKeysResponse", - "ReleaseChannel", - "IntraNodeVisibilityConfig", - "MaxPodsConstraint", - "WorkloadIdentityConfig", - "DatabaseEncryption", - "ListUsableSubnetworksRequest", - "ListUsableSubnetworksResponse", - "UsableSubnetworkSecondaryRange", + "TimeWindow", + "UpdateClusterRequest", + "UpdateMasterRequest", + "UpdateNodePoolRequest", "UsableSubnetwork", - "ResourceUsageExportConfig", + "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", - "DefaultSnatStatus", - "ShieldedNodes", + "WorkloadIdentityConfig", + "WorkloadMetadataConfig", ) diff --git a/google/cloud/container_v1/types/cluster_service.py b/google/cloud/container_v1/types/cluster_service.py index 0706e501..f8a90da9 100644 --- a/google/cloud/container_v1/types/cluster_service.py +++ b/google/cloud/container_v1/types/cluster_service.py @@ -160,7 +160,7 @@ class NodeConfig(proto.Message): address of the Service Account; otherwise, if no Service Account is specified, the "default" service account is used. - metadata (Sequence[~.cluster_service.NodeConfig.MetadataEntry]): + metadata (Sequence[google.cloud.container_v1.types.NodeConfig.MetadataEntry]): The metadata key/value pairs assigned to instances in the cluster. @@ -205,7 +205,7 @@ class NodeConfig(proto.Message): The image type to use for this node. Note that for a given image type, the latest version of it will be used. - labels (Sequence[~.cluster_service.NodeConfig.LabelsEntry]): + labels (Sequence[google.cloud.container_v1.types.NodeConfig.LabelsEntry]): The map of Kubernetes labels (key/value pairs) to be applied to each node. These will added in addition to any default label(s) that @@ -239,7 +239,7 @@ class NodeConfig(proto.Message): https://cloud.google.com/compute/docs/instances/preemptible for more information about preemptible VM instances. - accelerators (Sequence[~.cluster_service.AcceleratorConfig]): + accelerators (Sequence[google.cloud.container_v1.types.AcceleratorConfig]): A list of hardware accelerators to be attached to each node. See https://cloud.google.com/compute/docs/gpus for @@ -258,29 +258,29 @@ class NodeConfig(proto.Message): ``minCpuPlatform: "Intel Sandy Bridge"``. For more information, read `how to specify min CPU platform `__ - workload_metadata_config (~.cluster_service.WorkloadMetadataConfig): + workload_metadata_config (google.cloud.container_v1.types.WorkloadMetadataConfig): The workload metadata configuration for this node. - taints (Sequence[~.cluster_service.NodeTaint]): + taints (Sequence[google.cloud.container_v1.types.NodeTaint]): List of kubernetes taints to be applied to each node. For more information, including usage and the valid values, see: https://kubernetes.io/docs/concepts/configuration/taint- and-toleration/ - sandbox_config (~.cluster_service.SandboxConfig): + sandbox_config (google.cloud.container_v1.types.SandboxConfig): Sandbox configuration for this node. node_group (str): Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on `sole tenant nodes `__. - reservation_affinity (~.cluster_service.ReservationAffinity): + reservation_affinity (google.cloud.container_v1.types.ReservationAffinity): The optional reservation affinity. Setting this field will apply the specified `Zonal Compute Reservation `__ to this node pool. - shielded_instance_config (~.cluster_service.ShieldedInstanceConfig): + shielded_instance_config (google.cloud.container_v1.types.ShieldedInstanceConfig): Shielded Instance options. boot_disk_kms_key (str): The Customer Managed Encryption Key used to encrypt the boot @@ -374,7 +374,7 @@ class SandboxConfig(proto.Message): for the node. Attributes: - type_ (~.cluster_service.SandboxConfig.Type): + type_ (google.cloud.container_v1.types.SandboxConfig.Type): Type of the sandbox to use for the node. """ @@ -392,7 +392,7 @@ class ReservationAffinity(proto.Message): take capacity from. Attributes: - consume_reservation_type (~.cluster_service.ReservationAffinity.Type): + consume_reservation_type (google.cloud.container_v1.types.ReservationAffinity.Type): Corresponds to the type of reservation consumption. key (str): @@ -435,7 +435,7 @@ class NodeTaint(proto.Message): Key for taint. value (str): Value for taint. - effect (~.cluster_service.NodeTaint.Effect): + effect (google.cloud.container_v1.types.NodeTaint.Effect): Effect for taint. """ @@ -485,7 +485,7 @@ class MasterAuth(proto.Message): authentication methods, see: https://cloud.google.com/kubernetes- engine/docs/how-to/api-server-authentication - client_certificate_config (~.cluster_service.ClientCertificateConfig): + client_certificate_config (google.cloud.container_v1.types.ClientCertificateConfig): Configuration for client certificate authentication on the cluster. For clusters before v1.12, if no configuration is specified, @@ -532,18 +532,18 @@ class AddonsConfig(proto.Message): up in the cluster, enabling additional functionality. Attributes: - http_load_balancing (~.cluster_service.HttpLoadBalancing): + http_load_balancing (google.cloud.container_v1.types.HttpLoadBalancing): Configuration for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster. - horizontal_pod_autoscaling (~.cluster_service.HorizontalPodAutoscaling): + horizontal_pod_autoscaling (google.cloud.container_v1.types.HorizontalPodAutoscaling): Configuration for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods. - kubernetes_dashboard (~.cluster_service.KubernetesDashboard): + kubernetes_dashboard (google.cloud.container_v1.types.KubernetesDashboard): Configuration for the Kubernetes Dashboard. This addon is deprecated, and will be disabled in 1.15. It is recommended to use the Cloud @@ -552,19 +552,19 @@ class AddonsConfig(proto.Message): information, see: https://cloud.google.com/kubernetes- engine/docs/concepts/dashboards - network_policy_config (~.cluster_service.NetworkPolicyConfig): + network_policy_config (google.cloud.container_v1.types.NetworkPolicyConfig): Configuration for NetworkPolicy. This only tracks whether the addon is enabled or not on the Master, it does not track whether network policy is enabled for the nodes. - cloud_run_config (~.cluster_service.CloudRunConfig): + cloud_run_config (google.cloud.container_v1.types.CloudRunConfig): Configuration for the Cloud Run addon, which allows the user to use a managed Knative service. - dns_cache_config (~.cluster_service.DnsCacheConfig): + dns_cache_config (google.cloud.container_v1.types.DnsCacheConfig): Configuration for NodeLocalDNS, a dns cache running on cluster nodes - config_connector_config (~.cluster_service.ConfigConnectorConfig): + config_connector_config (google.cloud.container_v1.types.ConfigConnectorConfig): Configuration for the ConfigConnector add-on, a Kubernetes extension to manage hosted GCP services through the Kubernetes API @@ -706,7 +706,7 @@ class PrivateClusterConfig(proto.Message): peering_name (str): Output only. The peering name in the customer VPC used by this cluster. - master_global_access_config (~.cluster_service.PrivateClusterMasterGlobalAccessConfig): + master_global_access_config (google.cloud.container_v1.types.PrivateClusterMasterGlobalAccessConfig): Controls master global access settings. """ @@ -753,7 +753,7 @@ class CloudRunConfig(proto.Message): disabled (bool): Whether Cloud Run addon is enabled for this cluster. - load_balancer_type (~.cluster_service.CloudRunConfig.LoadBalancerType): + load_balancer_type (google.cloud.container_v1.types.CloudRunConfig.LoadBalancerType): Which load balancer type is installed for Cloud Run. """ @@ -792,7 +792,7 @@ class MasterAuthorizedNetworksConfig(proto.Message): enabled (bool): Whether or not master authorized networks is enabled. - cidr_blocks (Sequence[~.cluster_service.MasterAuthorizedNetworksConfig.CidrBlock]): + cidr_blocks (Sequence[google.cloud.container_v1.types.MasterAuthorizedNetworksConfig.CidrBlock]): cidr_blocks define up to 50 external networks that could access Kubernetes master through HTTPS. """ @@ -840,7 +840,7 @@ class NetworkPolicy(proto.Message): networking/networkpolicies/ Attributes: - provider (~.cluster_service.NetworkPolicy.Provider): + provider (google.cloud.container_v1.types.NetworkPolicy.Provider): The selected network policy provider. enabled (bool): Whether network policy is enabled on the @@ -1044,7 +1044,7 @@ class Cluster(proto.Message): This field is deprecated, use node_pool.initial_node_count instead. - node_config (~.cluster_service.NodeConfig): + node_config (google.cloud.container_v1.types.NodeConfig): Parameters used in creating the cluster's nodes. For requests, this field should only be used in lieu of a "node_pool" object, since this configuration (along with the @@ -1057,7 +1057,7 @@ class Cluster(proto.Message): If unspecified, the defaults are used. This field is deprecated, use node_pool.config instead. - master_auth (~.cluster_service.MasterAuth): + master_auth (google.cloud.container_v1.types.MasterAuth): The authentication information for accessing the master endpoint. If unspecified, the defaults are used: For clusters before v1.12, if master_auth is unspecified, @@ -1104,14 +1104,14 @@ class Cluster(proto.Message): notation (e.g. ``10.96.0.0/14``). Leave blank to have one automatically chosen or specify a ``/14`` block in ``10.0.0.0/8``. - addons_config (~.cluster_service.AddonsConfig): + addons_config (google.cloud.container_v1.types.AddonsConfig): Configurations for the various addons available to run in the cluster. subnetwork (str): The name of the Google Compute Engine `subnetwork `__ to which the cluster is connected. - node_pools (Sequence[~.cluster_service.NodePool]): + node_pools (Sequence[google.cloud.container_v1.types.NodePool]): The node pools associated with this cluster. This field should not be set if "node_config" or "initial_node_count" are specified. @@ -1137,57 +1137,57 @@ class Cluster(proto.Message): uptime and master/node upgrades are disabled. Alpha enabled clusters are automatically deleted thirty days after creation. - resource_labels (Sequence[~.cluster_service.Cluster.ResourceLabelsEntry]): + resource_labels (Sequence[google.cloud.container_v1.types.Cluster.ResourceLabelsEntry]): The resource labels for the cluster to use to annotate any related Google Compute Engine resources. label_fingerprint (str): The fingerprint of the set of labels for this cluster. - legacy_abac (~.cluster_service.LegacyAbac): + legacy_abac (google.cloud.container_v1.types.LegacyAbac): Configuration for the legacy ABAC authorization mode. - network_policy (~.cluster_service.NetworkPolicy): + network_policy (google.cloud.container_v1.types.NetworkPolicy): Configuration options for the NetworkPolicy feature. - ip_allocation_policy (~.cluster_service.IPAllocationPolicy): + ip_allocation_policy (google.cloud.container_v1.types.IPAllocationPolicy): Configuration for cluster IP allocation. - master_authorized_networks_config (~.cluster_service.MasterAuthorizedNetworksConfig): + master_authorized_networks_config (google.cloud.container_v1.types.MasterAuthorizedNetworksConfig): The configuration options for master authorized networks feature. - maintenance_policy (~.cluster_service.MaintenancePolicy): + maintenance_policy (google.cloud.container_v1.types.MaintenancePolicy): Configure the maintenance policy for this cluster. - binary_authorization (~.cluster_service.BinaryAuthorization): + binary_authorization (google.cloud.container_v1.types.BinaryAuthorization): Configuration for Binary Authorization. - autoscaling (~.cluster_service.ClusterAutoscaling): + autoscaling (google.cloud.container_v1.types.ClusterAutoscaling): Cluster-level autoscaling configuration. - network_config (~.cluster_service.NetworkConfig): + network_config (google.cloud.container_v1.types.NetworkConfig): Configuration for cluster networking. - default_max_pods_constraint (~.cluster_service.MaxPodsConstraint): + default_max_pods_constraint (google.cloud.container_v1.types.MaxPodsConstraint): The default constraint on the maximum number of pods that can be run simultaneously on a node in the node pool of this cluster. Only honored if cluster created with IP Alias support. - resource_usage_export_config (~.cluster_service.ResourceUsageExportConfig): + resource_usage_export_config (google.cloud.container_v1.types.ResourceUsageExportConfig): Configuration for exporting resource usages. Resource usage export is disabled when this config is unspecified. - authenticator_groups_config (~.cluster_service.AuthenticatorGroupsConfig): + authenticator_groups_config (google.cloud.container_v1.types.AuthenticatorGroupsConfig): Configuration controlling RBAC group membership information. - private_cluster_config (~.cluster_service.PrivateClusterConfig): + private_cluster_config (google.cloud.container_v1.types.PrivateClusterConfig): Configuration for private cluster. - database_encryption (~.cluster_service.DatabaseEncryption): + database_encryption (google.cloud.container_v1.types.DatabaseEncryption): Configuration of etcd encryption. - vertical_pod_autoscaling (~.cluster_service.VerticalPodAutoscaling): + vertical_pod_autoscaling (google.cloud.container_v1.types.VerticalPodAutoscaling): Cluster-level Vertical Pod Autoscaling configuration. - shielded_nodes (~.cluster_service.ShieldedNodes): + shielded_nodes (google.cloud.container_v1.types.ShieldedNodes): Shielded Nodes configuration. - release_channel (~.cluster_service.ReleaseChannel): + release_channel (google.cloud.container_v1.types.ReleaseChannel): Release channel configuration. - workload_identity_config (~.cluster_service.WorkloadIdentityConfig): + workload_identity_config (google.cloud.container_v1.types.WorkloadIdentityConfig): Configuration for the use of Kubernetes Service Accounts in GCP IAM policies. self_link (str): @@ -1236,7 +1236,7 @@ class Cluster(proto.Message): [Output only] The time the cluster was created, in `RFC3339 `__ text format. - status (~.cluster_service.Cluster.Status): + status (google.cloud.container_v1.types.Cluster.Status): [Output only] The current status of this cluster. status_message (str): [Output only] Deprecated. Use conditions instead. Additional @@ -1278,7 +1278,7 @@ class Cluster(proto.Message): cluster, in `CIDR `__ notation (e.g. ``1.2.3.4/29``). - conditions (Sequence[~.cluster_service.StatusCondition]): + conditions (Sequence[google.cloud.container_v1.types.StatusCondition]): Which conditions caused the current cluster state. """ @@ -1455,7 +1455,7 @@ class ClusterUpdate(proto.Message): string,\ ``monitoring.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``monitoring.googleapis.com`` for earlier versions. - desired_addons_config (~.cluster_service.AddonsConfig): + desired_addons_config (google.cloud.container_v1.types.AddonsConfig): Configurations for the various addons available to run in the cluster. desired_node_pool_id (str): @@ -1466,13 +1466,13 @@ class ClusterUpdate(proto.Message): desired_image_type (str): The desired image type for the node pool. NOTE: Set the "desired_node_pool" field as well. - desired_database_encryption (~.cluster_service.DatabaseEncryption): + desired_database_encryption (google.cloud.container_v1.types.DatabaseEncryption): Configuration of etcd encryption. - desired_workload_identity_config (~.cluster_service.WorkloadIdentityConfig): + desired_workload_identity_config (google.cloud.container_v1.types.WorkloadIdentityConfig): Configuration for Workload Identity. - desired_shielded_nodes (~.cluster_service.ShieldedNodes): + desired_shielded_nodes (google.cloud.container_v1.types.ShieldedNodes): Configuration for Shielded Nodes. - desired_node_pool_autoscaling (~.cluster_service.NodePoolAutoscaling): + desired_node_pool_autoscaling (google.cloud.container_v1.types.NodePoolAutoscaling): Autoscaler configuration for the node pool specified in desired_node_pool_id. If there is only one pool in the cluster and desired_node_pool_id is not provided then the @@ -1487,12 +1487,12 @@ class ClusterUpdate(proto.Message): Warning: changing cluster locations will update the locations of all node pools and will result in nodes being added and/or removed. - desired_master_authorized_networks_config (~.cluster_service.MasterAuthorizedNetworksConfig): + desired_master_authorized_networks_config (google.cloud.container_v1.types.MasterAuthorizedNetworksConfig): The desired configuration options for master authorized networks feature. - desired_cluster_autoscaling (~.cluster_service.ClusterAutoscaling): + desired_cluster_autoscaling (google.cloud.container_v1.types.ClusterAutoscaling): Cluster-level autoscaling configuration. - desired_binary_authorization (~.cluster_service.BinaryAuthorization): + desired_binary_authorization (google.cloud.container_v1.types.BinaryAuthorization): The desired configuration options for the Binary Authorization feature. desired_logging_service (str): @@ -1509,20 +1509,20 @@ class ClusterUpdate(proto.Message): string,\ ``logging.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``logging.googleapis.com`` for earlier versions. - desired_resource_usage_export_config (~.cluster_service.ResourceUsageExportConfig): + desired_resource_usage_export_config (google.cloud.container_v1.types.ResourceUsageExportConfig): The desired configuration for exporting resource usage. - desired_vertical_pod_autoscaling (~.cluster_service.VerticalPodAutoscaling): + desired_vertical_pod_autoscaling (google.cloud.container_v1.types.VerticalPodAutoscaling): Cluster-level Vertical Pod Autoscaling configuration. - desired_private_cluster_config (~.cluster_service.PrivateClusterConfig): + desired_private_cluster_config (google.cloud.container_v1.types.PrivateClusterConfig): The desired private cluster configuration. - desired_intra_node_visibility_config (~.cluster_service.IntraNodeVisibilityConfig): + desired_intra_node_visibility_config (google.cloud.container_v1.types.IntraNodeVisibilityConfig): The desired config of Intra-node visibility. - desired_default_snat_status (~.cluster_service.DefaultSnatStatus): + desired_default_snat_status (google.cloud.container_v1.types.DefaultSnatStatus): The desired status of whether to disable default sNAT for this cluster. - desired_release_channel (~.cluster_service.ReleaseChannel): + desired_release_channel (google.cloud.container_v1.types.ReleaseChannel): The desired release channel configuration. desired_master_version (str): The Kubernetes version to change the master @@ -1623,9 +1623,9 @@ class Operation(proto.Message): `zone `__ in which the operation is taking place. This field is deprecated, use location instead. - operation_type (~.cluster_service.Operation.Type): + operation_type (google.cloud.container_v1.types.Operation.Type): The operation type. - status (~.cluster_service.Operation.Status): + status (google.cloud.container_v1.types.Operation.Status): The current status of the operation. detail (str): Detailed operation progress, if available. @@ -1651,13 +1651,13 @@ class Operation(proto.Message): [Output only] The time the operation completed, in `RFC3339 `__ text format. - progress (~.cluster_service.OperationProgress): + progress (google.cloud.container_v1.types.OperationProgress): Output only. [Output only] Progress information for an operation. - cluster_conditions (Sequence[~.cluster_service.StatusCondition]): + cluster_conditions (Sequence[google.cloud.container_v1.types.StatusCondition]): Which conditions caused the current cluster state. - nodepool_conditions (Sequence[~.cluster_service.StatusCondition]): + nodepool_conditions (Sequence[google.cloud.container_v1.types.StatusCondition]): Which conditions caused the current node pool state. """ @@ -1731,15 +1731,15 @@ class OperationProgress(proto.Message): A non-parameterized string describing an operation stage. Unset for single-stage operations. - status (~.cluster_service.Operation.Status): + status (google.cloud.container_v1.types.Operation.Status): Status of an operation stage. Unset for single-stage operations. - metrics (Sequence[~.cluster_service.OperationProgress.Metric]): + metrics (Sequence[google.cloud.container_v1.types.OperationProgress.Metric]): Progress metric bundle, for example: metrics: [{name: "nodes done", int_value: 15}, {name: "nodes total", int_value: 32}] or metrics: [{name: "progress", double_value: 0.56}, {name: "progress scale", double_value: 1.0}] - stages (Sequence[~.cluster_service.OperationProgress]): + stages (Sequence[google.cloud.container_v1.types.OperationProgress]): Substages of an operation or a stage. """ @@ -1791,7 +1791,7 @@ class CreateClusterRequest(proto.Message): `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. - cluster (~.cluster_service.Cluster): + cluster (google.cloud.container_v1.types.Cluster): Required. A `cluster resource `__ parent (str): @@ -1861,7 +1861,7 @@ class UpdateClusterRequest(proto.Message): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - update (~.cluster_service.ClusterUpdate): + update (google.cloud.container_v1.types.ClusterUpdate): Required. A description of the update. name (str): The name (project, location, cluster) of the cluster to @@ -1932,10 +1932,10 @@ class UpdateNodePoolRequest(proto.Message): the locations for a node pool will result in nodes being either created or removed from the node pool, depending on whether locations are being added or removed. - workload_metadata_config (~.cluster_service.WorkloadMetadataConfig): + workload_metadata_config (google.cloud.container_v1.types.WorkloadMetadataConfig): The desired workload metadata config for the node pool. - upgrade_settings (~.cluster_service.NodePool.UpgradeSettings): + upgrade_settings (google.cloud.container_v1.types.NodePool.UpgradeSettings): Upgrade settings control disruption and speed of the upgrade. """ @@ -1989,7 +1989,7 @@ class SetNodePoolAutoscalingRequest(proto.Message): Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. - autoscaling (~.cluster_service.NodePoolAutoscaling): + autoscaling (google.cloud.container_v1.types.NodePoolAutoscaling): Required. Autoscaling configuration for the node pool. name (str): @@ -2134,7 +2134,7 @@ class SetAddonsConfigRequest(proto.Message): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - addons_config (~.cluster_service.AddonsConfig): + addons_config (google.cloud.container_v1.types.AddonsConfig): Required. The desired configurations for the various addons available to run in the cluster. name (str): @@ -2267,10 +2267,10 @@ class SetMasterAuthRequest(proto.Message): Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - action (~.cluster_service.SetMasterAuthRequest.Action): + action (google.cloud.container_v1.types.SetMasterAuthRequest.Action): Required. The exact form of action to be taken on the master auth. - update (~.cluster_service.MasterAuth): + update (google.cloud.container_v1.types.MasterAuth): Required. A description of the update. name (str): The name (project, location, cluster) of the cluster to set @@ -2364,7 +2364,7 @@ class ListClustersResponse(proto.Message): r"""ListClustersResponse is the result of ListClustersRequest. Attributes: - clusters (Sequence[~.cluster_service.Cluster]): + clusters (Sequence[google.cloud.container_v1.types.Cluster]): A list of clusters in the project in the specified zone, or across all ones. missing_zones (Sequence[str]): @@ -2479,7 +2479,7 @@ class ListOperationsResponse(proto.Message): ListOperationsRequest. Attributes: - operations (Sequence[~.cluster_service.Operation]): + operations (Sequence[google.cloud.container_v1.types.Operation]): A list of operations in the project in the specified zone. missing_zones (Sequence[str]): @@ -2537,7 +2537,7 @@ class ServerConfig(proto.Message): valid_master_versions (Sequence[str]): List of valid master versions, in descending order. - channels (Sequence[~.cluster_service.ServerConfig.ReleaseChannelConfig]): + channels (Sequence[google.cloud.container_v1.types.ServerConfig.ReleaseChannelConfig]): List of release channel configurations. """ @@ -2546,7 +2546,7 @@ class ReleaseChannelConfig(proto.Message): channel. Attributes: - channel (~.cluster_service.ReleaseChannel.Channel): + channel (google.cloud.container_v1.types.ReleaseChannel.Channel): The release channel this configuration applies to. default_version (str): @@ -2596,7 +2596,7 @@ class CreateNodePoolRequest(proto.Message): Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - node_pool (~.cluster_service.NodePool): + node_pool (google.cloud.container_v1.types.NodePool): Required. The node pool to create. parent (str): The parent (project, location, cluster id) where the node @@ -2741,7 +2741,7 @@ class NodePool(proto.Message): Attributes: name (str): The name of the node pool. - config (~.cluster_service.NodeConfig): + config (google.cloud.container_v1.types.NodeConfig): The node configuration of the pool. initial_node_count (int): The initial node count for the pool. You must ensure that @@ -2768,30 +2768,30 @@ class NodePool(proto.Message): [Output only] The resource URLs of the `managed instance groups `__ associated with this node pool. - status (~.cluster_service.NodePool.Status): + status (google.cloud.container_v1.types.NodePool.Status): [Output only] The status of the nodes in this pool instance. status_message (str): [Output only] Deprecated. Use conditions instead. Additional information about the current status of this node pool instance, if available. - autoscaling (~.cluster_service.NodePoolAutoscaling): + autoscaling (google.cloud.container_v1.types.NodePoolAutoscaling): Autoscaler configuration for this NodePool. Autoscaler is enabled only if a valid configuration is present. - management (~.cluster_service.NodeManagement): + management (google.cloud.container_v1.types.NodeManagement): NodeManagement configuration for this NodePool. - max_pods_constraint (~.cluster_service.MaxPodsConstraint): + max_pods_constraint (google.cloud.container_v1.types.MaxPodsConstraint): The constraint on the maximum number of pods that can be run simultaneously on a node in the node pool. - conditions (Sequence[~.cluster_service.StatusCondition]): + conditions (Sequence[google.cloud.container_v1.types.StatusCondition]): Which conditions caused the current node pool state. pod_ipv4_cidr_size (int): [Output only] The pod CIDR block size per node in this node pool. - upgrade_settings (~.cluster_service.NodePool.UpgradeSettings): + upgrade_settings (google.cloud.container_v1.types.NodePool.UpgradeSettings): Upgrade settings control disruption and speed of the upgrade. """ @@ -2900,7 +2900,7 @@ class NodeManagement(proto.Message): the nodes in this node pool will be monitored and, if they fail health checks too many times, an automatic repair action will be triggered. - upgrade_options (~.cluster_service.AutoUpgradeOptions): + upgrade_options (google.cloud.container_v1.types.AutoUpgradeOptions): Specifies the Auto Upgrade knobs for the node pool. """ @@ -2939,7 +2939,7 @@ class MaintenancePolicy(proto.Message): for the cluster. Attributes: - window (~.cluster_service.MaintenanceWindow): + window (google.cloud.container_v1.types.MaintenanceWindow): Specifies the maintenance window in which maintenance may be performed. resource_version (str): @@ -2962,16 +2962,16 @@ class MaintenanceWindow(proto.Message): for the cluster. Attributes: - daily_maintenance_window (~.cluster_service.DailyMaintenanceWindow): + daily_maintenance_window (google.cloud.container_v1.types.DailyMaintenanceWindow): DailyMaintenanceWindow specifies a daily maintenance operation window. - recurring_window (~.cluster_service.RecurringTimeWindow): + recurring_window (google.cloud.container_v1.types.RecurringTimeWindow): RecurringWindow specifies some number of recurring time periods for maintenance to occur. The time windows may be overlapping. If no maintenance windows are set, maintenance can occur at any time. - maintenance_exclusions (Sequence[~.cluster_service.MaintenanceWindow.MaintenanceExclusionsEntry]): + maintenance_exclusions (Sequence[google.cloud.container_v1.types.MaintenanceWindow.MaintenanceExclusionsEntry]): Exceptions to maintenance window. Non- mergency maintenance should not occur in these windows. @@ -2994,9 +2994,9 @@ class TimeWindow(proto.Message): r"""Represents an arbitrary window of time. Attributes: - start_time (~.timestamp.Timestamp): + start_time (google.protobuf.timestamp_pb2.Timestamp): The time that the window first starts. - end_time (~.timestamp.Timestamp): + end_time (google.protobuf.timestamp_pb2.Timestamp): The time that the window ends. The end time should take place after the start time. """ @@ -3010,7 +3010,7 @@ class RecurringTimeWindow(proto.Message): r"""Represents an arbitrary window of time that recurs. Attributes: - window (~.cluster_service.TimeWindow): + window (google.cloud.container_v1.types.TimeWindow): The window of the first recurrence. recurrence (str): An RRULE @@ -3104,7 +3104,7 @@ class SetNodePoolManagementRequest(proto.Message): Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. - management (~.cluster_service.NodeManagement): + management (google.cloud.container_v1.types.NodeManagement): Required. NodeManagement configuration for the node pool. name (str): @@ -3218,7 +3218,7 @@ class ListNodePoolsResponse(proto.Message): r"""ListNodePoolsResponse is the result of ListNodePoolsRequest. Attributes: - node_pools (Sequence[~.cluster_service.NodePool]): + node_pools (Sequence[google.cloud.container_v1.types.NodePool]): A list of node pools for a cluster. """ @@ -3235,10 +3235,10 @@ class ClusterAutoscaling(proto.Message): enable_node_autoprovisioning (bool): Enables automatic node pool creation and deletion. - resource_limits (Sequence[~.cluster_service.ResourceLimit]): + resource_limits (Sequence[google.cloud.container_v1.types.ResourceLimit]): Contains global constraints regarding minimum and maximum amount of resources in the cluster. - autoprovisioning_node_pool_defaults (~.cluster_service.AutoprovisioningNodePoolDefaults): + autoprovisioning_node_pool_defaults (google.cloud.container_v1.types.AutoprovisioningNodePoolDefaults): AutoprovisioningNodePoolDefaults contains defaults for a node pool created by NAP. autoprovisioning_locations (Sequence[str]): @@ -3271,10 +3271,10 @@ class AutoprovisioningNodePoolDefaults(proto.Message): service_account (str): The Google Cloud Platform Service Account to be used by the node VMs. - upgrade_settings (~.cluster_service.NodePool.UpgradeSettings): + upgrade_settings (google.cloud.container_v1.types.NodePool.UpgradeSettings): Specifies the upgrade settings for NAP created node pools - management (~.cluster_service.NodeManagement): + management (google.cloud.container_v1.types.NodeManagement): Specifies the node management options for NAP created node-pools. min_cpu_platform (str): @@ -3298,7 +3298,7 @@ class AutoprovisioningNodePoolDefaults(proto.Message): If unspecified, the default disk type is 'pd- standard' - shielded_instance_config (~.cluster_service.ShieldedInstanceConfig): + shielded_instance_config (google.cloud.container_v1.types.ShieldedInstanceConfig): Shielded Instance options. boot_disk_kms_key (str): The Customer Managed Encryption Key used to encrypt the boot @@ -3405,7 +3405,7 @@ class SetLabelsRequest(proto.Message): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - resource_labels (Sequence[~.cluster_service.SetLabelsRequest.ResourceLabelsEntry]): + resource_labels (Sequence[google.cloud.container_v1.types.SetLabelsRequest.ResourceLabelsEntry]): Required. The labels to set for that cluster. label_fingerprint (str): Required. The fingerprint of the previous set of labels for @@ -3573,7 +3573,7 @@ class WorkloadMetadataConfig(proto.Message): expose to workloads on the node pool. Attributes: - mode (~.cluster_service.WorkloadMetadataConfig.Mode): + mode (google.cloud.container_v1.types.WorkloadMetadataConfig.Mode): Mode is the configuration for how to expose metadata to workloads running on the node pool. """ @@ -3609,7 +3609,7 @@ class SetNetworkPolicyRequest(proto.Message): Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - network_policy (~.cluster_service.NetworkPolicy): + network_policy (google.cloud.container_v1.types.NetworkPolicy): Required. Configuration options for the NetworkPolicy feature. name (str): @@ -3644,7 +3644,7 @@ class SetMaintenancePolicyRequest(proto.Message): in which the cluster resides. cluster_id (str): Required. The name of the cluster to update. - maintenance_policy (~.cluster_service.MaintenancePolicy): + maintenance_policy (google.cloud.container_v1.types.MaintenancePolicy): Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy. @@ -3672,7 +3672,7 @@ class StatusCondition(proto.Message): certain status (e.g., ERROR or DEGRADED). Attributes: - code (~.cluster_service.StatusCondition.Code): + code (google.cloud.container_v1.types.StatusCondition.Code): Machine-friendly representation of the condition message (str): @@ -3713,7 +3713,7 @@ class NetworkConfig(proto.Message): Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. - default_snat_status (~.cluster_service.DefaultSnatStatus): + default_snat_status (google.cloud.container_v1.types.DefaultSnatStatus): Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when default_snat_status is disabled. When disabled is set to false, default IP @@ -3848,7 +3848,7 @@ class GetJSONWebKeysResponse(proto.Message): specififed in rfc 7517 Attributes: - keys (Sequence[~.cluster_service.Jwk]): + keys (Sequence[google.cloud.container_v1.types.Jwk]): The public component of the keys used by the cluster to sign token requests. """ @@ -3864,7 +3864,7 @@ class ReleaseChannel(proto.Message): auto-upgrade defaults to true and cannot be disabled. Attributes: - channel (~.cluster_service.ReleaseChannel.Channel): + channel (google.cloud.container_v1.types.ReleaseChannel.Channel): channel specifies which release channel the cluster is subscribed to. """ @@ -3921,7 +3921,7 @@ class DatabaseEncryption(proto.Message): r"""Configuration of etcd encryption. Attributes: - state (~.cluster_service.DatabaseEncryption.State): + state (google.cloud.container_v1.types.DatabaseEncryption.State): Denotes the state of etcd encryption. key_name (str): Name of CloudKMS key to use for the @@ -3982,7 +3982,7 @@ class ListUsableSubnetworksResponse(proto.Message): ListUsableSubnetworksRequest. Attributes: - subnetworks (Sequence[~.cluster_service.UsableSubnetwork]): + subnetworks (Sequence[google.cloud.container_v1.types.UsableSubnetwork]): A list of usable subnetworks in the specified network project. next_page_token (str): @@ -4015,7 +4015,7 @@ class UsableSubnetworkSecondaryRange(proto.Message): ip_cidr_range (str): The range of IP addresses belonging to this subnetwork secondary range. - status (~.cluster_service.UsableSubnetworkSecondaryRange.Status): + status (google.cloud.container_v1.types.UsableSubnetworkSecondaryRange.Status): This field is to determine the status of the secondary range programmably. """ @@ -4051,7 +4051,7 @@ class UsableSubnetwork(proto.Message): ip_cidr_range (str): The range of internal addresses that are owned by this subnetwork. - secondary_ip_ranges (Sequence[~.cluster_service.UsableSubnetworkSecondaryRange]): + secondary_ip_ranges (Sequence[google.cloud.container_v1.types.UsableSubnetworkSecondaryRange]): Secondary IP ranges. status_message (str): A human readable status message representing the reasons for @@ -4078,7 +4078,7 @@ class ResourceUsageExportConfig(proto.Message): r"""Configuration for exporting cluster resource usages. Attributes: - bigquery_destination (~.cluster_service.ResourceUsageExportConfig.BigQueryDestination): + bigquery_destination (google.cloud.container_v1.types.ResourceUsageExportConfig.BigQueryDestination): Configuration to use BigQuery as usage export destination. enable_network_egress_metering (bool): @@ -4086,7 +4086,7 @@ class ResourceUsageExportConfig(proto.Message): this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. - consumption_metering_config (~.cluster_service.ResourceUsageExportConfig.ConsumptionMeteringConfig): + consumption_metering_config (google.cloud.container_v1.types.ResourceUsageExportConfig.ConsumptionMeteringConfig): Configuration to enable resource consumption metering. """ diff --git a/google/cloud/container_v1beta1/proto/cluster_service.proto b/google/cloud/container_v1beta1/proto/cluster_service.proto index bad80382..fa4c3ba3 100644 --- a/google/cloud/container_v1beta1/proto/cluster_service.proto +++ b/google/cloud/container_v1beta1/proto/cluster_service.proto @@ -4058,7 +4058,7 @@ enum DatapathProvider { // Use the eBPF based GKE Dataplane V2 with additional features. See the [GKE // Dataplane V2 - // documentation](https://cloud.google.com/kubernetes-enginw/docs/how-to/dataplane-v2) + // documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/dataplane-v2) // for more. ADVANCED_DATAPATH = 2; } diff --git a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py index 36da61fb..e8137869 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/async_client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/async_client.py @@ -77,7 +77,36 @@ class ClusterManagerAsyncClient: ClusterManagerClient.parse_common_location_path ) - from_service_account_file = ClusterManagerClient.from_service_account_file + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ClusterManagerAsyncClient: The constructed client. + """ + return ClusterManagerClient.from_service_account_info.__func__(ClusterManagerAsyncClient, info, *args, **kwargs) # type: ignore + + @classmethod + def from_service_account_file(cls, filename: str, *args, **kwargs): + """Creates an instance of this client using the provided credentials + file. + + Args: + filename (str): The path to the service account private key json + file. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ClusterManagerAsyncClient: The constructed client. + """ + return ClusterManagerClient.from_service_account_file.__func__(ClusterManagerAsyncClient, filename, *args, **kwargs) # type: ignore + from_service_account_json = from_service_account_file @property @@ -155,7 +184,7 @@ async def list_clusters( specified zone or all zones. Args: - request (:class:`~.cluster_service.ListClustersRequest`): + request (:class:`google.cloud.container_v1beta1.types.ListClustersRequest`): The request object. ListClustersRequest lists clusters. project_id (:class:`str`): Required. Deprecated. The Google Developers Console @@ -163,6 +192,7 @@ async def list_clusters( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -173,6 +203,7 @@ async def list_clusters( in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -184,7 +215,7 @@ async def list_clusters( sent along with the request as metadata. Returns: - ~.cluster_service.ListClustersResponse: + google.cloud.container_v1beta1.types.ListClustersResponse: ListClustersResponse is the result of ListClustersRequest. @@ -220,6 +251,7 @@ async def list_clusters( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -251,7 +283,7 @@ async def get_cluster( r"""Gets the details for a specific cluster. Args: - request (:class:`~.cluster_service.GetClusterRequest`): + request (:class:`google.cloud.container_v1beta1.types.GetClusterRequest`): The request object. GetClusterRequest gets the settings of a cluster. project_id (:class:`str`): @@ -260,6 +292,7 @@ async def get_cluster( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -269,6 +302,7 @@ async def get_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -277,6 +311,7 @@ async def get_cluster( cluster to retrieve. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -288,7 +323,7 @@ async def get_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Cluster: + google.cloud.container_v1beta1.types.Cluster: A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. @@ -324,6 +359,7 @@ async def get_cluster( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -367,7 +403,7 @@ async def create_cluster( indicating which CIDR range the cluster is using. Args: - request (:class:`~.cluster_service.CreateClusterRequest`): + request (:class:`google.cloud.container_v1beta1.types.CreateClusterRequest`): The request object. CreateClusterRequest creates a cluster. project_id (:class:`str`): @@ -376,6 +412,7 @@ async def create_cluster( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -385,12 +422,14 @@ async def create_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (:class:`~.cluster_service.Cluster`): + cluster (:class:`google.cloud.container_v1beta1.types.Cluster`): Required. A `cluster resource `__ + This corresponds to the ``cluster`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -402,7 +441,7 @@ async def create_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -466,7 +505,7 @@ async def update_cluster( r"""Updates the settings for a specific cluster. Args: - request (:class:`~.cluster_service.UpdateClusterRequest`): + request (:class:`google.cloud.container_v1beta1.types.UpdateClusterRequest`): The request object. UpdateClusterRequest updates the settings of a cluster. project_id (:class:`str`): @@ -475,6 +514,7 @@ async def update_cluster( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -484,6 +524,7 @@ async def update_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -492,12 +533,14 @@ async def update_cluster( cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - update (:class:`~.cluster_service.ClusterUpdate`): + update (:class:`google.cloud.container_v1beta1.types.ClusterUpdate`): Required. A description of the update. + This corresponds to the ``update`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -509,7 +552,7 @@ async def update_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -572,7 +615,7 @@ async def update_node_pool( node pool. Args: - request (:class:`~.cluster_service.UpdateNodePoolRequest`): + request (:class:`google.cloud.container_v1beta1.types.UpdateNodePoolRequest`): The request object. SetNodePoolVersionRequest updates the version of a node pool. @@ -583,7 +626,7 @@ async def update_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -626,7 +669,7 @@ async def set_node_pool_autoscaling( pool. Args: - request (:class:`~.cluster_service.SetNodePoolAutoscalingRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetNodePoolAutoscalingRequest`): The request object. SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. @@ -637,7 +680,7 @@ async def set_node_pool_autoscaling( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -683,7 +726,7 @@ async def set_logging_service( r"""Sets the logging service for a specific cluster. Args: - request (:class:`~.cluster_service.SetLoggingServiceRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetLoggingServiceRequest`): The request object. SetLoggingServiceRequest sets the logging service of a cluster. project_id (:class:`str`): @@ -692,6 +735,7 @@ async def set_logging_service( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -701,6 +745,7 @@ async def set_logging_service( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -709,6 +754,7 @@ async def set_logging_service( cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -727,6 +773,7 @@ async def set_logging_service( string,\ ``logging.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``logging.googleapis.com`` for earlier versions. + This corresponds to the ``logging_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -738,7 +785,7 @@ async def set_logging_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -804,7 +851,7 @@ async def set_monitoring_service( r"""Sets the monitoring service for a specific cluster. Args: - request (:class:`~.cluster_service.SetMonitoringServiceRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetMonitoringServiceRequest`): The request object. SetMonitoringServiceRequest sets the monitoring service of a cluster. project_id (:class:`str`): @@ -813,6 +860,7 @@ async def set_monitoring_service( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -822,6 +870,7 @@ async def set_monitoring_service( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -830,6 +879,7 @@ async def set_monitoring_service( cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -850,6 +900,7 @@ async def set_monitoring_service( string,\ ``monitoring.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``monitoring.googleapis.com`` for earlier versions. + This corresponds to the ``monitoring_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -861,7 +912,7 @@ async def set_monitoring_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -927,7 +978,7 @@ async def set_addons_config( r"""Sets the addons for a specific cluster. Args: - request (:class:`~.cluster_service.SetAddonsConfigRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetAddonsConfigRequest`): The request object. SetAddonsRequest sets the addons associated with the cluster. project_id (:class:`str`): @@ -936,6 +987,7 @@ async def set_addons_config( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -945,6 +997,7 @@ async def set_addons_config( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -953,13 +1006,15 @@ async def set_addons_config( cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - addons_config (:class:`~.cluster_service.AddonsConfig`): + addons_config (:class:`google.cloud.container_v1beta1.types.AddonsConfig`): Required. The desired configurations for the various addons available to run in the cluster. + This corresponds to the ``addons_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -971,7 +1026,7 @@ async def set_addons_config( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1039,7 +1094,7 @@ async def set_locations( instead. Args: - request (:class:`~.cluster_service.SetLocationsRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetLocationsRequest`): The request object. SetLocationsRequest sets the locations of the cluster. project_id (:class:`str`): @@ -1048,6 +1103,7 @@ async def set_locations( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1057,6 +1113,7 @@ async def set_locations( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1065,6 +1122,7 @@ async def set_locations( cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1078,6 +1136,7 @@ async def set_locations( This list must always include the cluster's primary zone. + This corresponds to the ``locations`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1089,7 +1148,7 @@ async def set_locations( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1156,7 +1215,7 @@ async def update_master( r"""Updates the master for a specific cluster. Args: - request (:class:`~.cluster_service.UpdateMasterRequest`): + request (:class:`google.cloud.container_v1beta1.types.UpdateMasterRequest`): The request object. UpdateMasterRequest updates the master of the cluster. project_id (:class:`str`): @@ -1165,6 +1224,7 @@ async def update_master( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1174,6 +1234,7 @@ async def update_master( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1182,6 +1243,7 @@ async def update_master( cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1200,6 +1262,7 @@ async def update_master( "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the default Kubernetes version + This corresponds to the ``master_version`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1211,7 +1274,7 @@ async def update_master( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1276,7 +1339,7 @@ async def set_master_auth( password. Args: - request (:class:`~.cluster_service.SetMasterAuthRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetMasterAuthRequest`): The request object. SetMasterAuthRequest updates the admin password of a cluster. @@ -1287,7 +1350,7 @@ async def set_master_auth( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1341,7 +1404,7 @@ async def delete_cluster( initially created. Args: - request (:class:`~.cluster_service.DeleteClusterRequest`): + request (:class:`google.cloud.container_v1beta1.types.DeleteClusterRequest`): The request object. DeleteClusterRequest deletes a cluster. project_id (:class:`str`): @@ -1350,6 +1413,7 @@ async def delete_cluster( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1359,6 +1423,7 @@ async def delete_cluster( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1367,6 +1432,7 @@ async def delete_cluster( cluster to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1378,7 +1444,7 @@ async def delete_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1418,6 +1484,7 @@ async def delete_cluster( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1449,7 +1516,7 @@ async def list_operations( zone or all zones. Args: - request (:class:`~.cluster_service.ListOperationsRequest`): + request (:class:`google.cloud.container_v1beta1.types.ListOperationsRequest`): The request object. ListOperationsRequest lists operations. project_id (:class:`str`): @@ -1458,6 +1525,7 @@ async def list_operations( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1468,6 +1536,7 @@ async def list_operations( to return operations for, or ``-`` for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1479,7 +1548,7 @@ async def list_operations( sent along with the request as metadata. Returns: - ~.cluster_service.ListOperationsResponse: + google.cloud.container_v1beta1.types.ListOperationsResponse: ListOperationsResponse is the result of ListOperationsRequest. @@ -1515,6 +1584,7 @@ async def list_operations( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1546,7 +1616,7 @@ async def get_operation( r"""Gets the specified operation. Args: - request (:class:`~.cluster_service.GetOperationRequest`): + request (:class:`google.cloud.container_v1beta1.types.GetOperationRequest`): The request object. GetOperationRequest gets a single operation. project_id (:class:`str`): @@ -1555,6 +1625,7 @@ async def get_operation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1564,6 +1635,7 @@ async def get_operation( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1571,6 +1643,7 @@ async def get_operation( Required. Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1582,7 +1655,7 @@ async def get_operation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1622,6 +1695,7 @@ async def get_operation( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1653,7 +1727,7 @@ async def cancel_operation( r"""Cancels the specified operation. Args: - request (:class:`~.cluster_service.CancelOperationRequest`): + request (:class:`google.cloud.container_v1beta1.types.CancelOperationRequest`): The request object. CancelOperationRequest cancels a single operation. project_id (:class:`str`): @@ -1662,6 +1736,7 @@ async def cancel_operation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1671,6 +1746,7 @@ async def cancel_operation( `zone `__ in which the operation resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1678,6 +1754,7 @@ async def cancel_operation( Required. Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1743,7 +1820,7 @@ async def get_server_config( Kubernetes Engine service. Args: - request (:class:`~.cluster_service.GetServerConfigRequest`): + request (:class:`google.cloud.container_v1beta1.types.GetServerConfigRequest`): The request object. Gets the current Kubernetes Engine service configuration. project_id (:class:`str`): @@ -1752,6 +1829,7 @@ async def get_server_config( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1761,6 +1839,7 @@ async def get_server_config( `zone `__ to return operations for. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1772,7 +1851,7 @@ async def get_server_config( sent along with the request as metadata. Returns: - ~.cluster_service.ServerConfig: + google.cloud.container_v1beta1.types.ServerConfig: Kubernetes Engine service configuration. @@ -1808,6 +1887,7 @@ async def get_server_config( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1839,7 +1919,7 @@ async def list_node_pools( r"""Lists the node pools for a cluster. Args: - request (:class:`~.cluster_service.ListNodePoolsRequest`): + request (:class:`google.cloud.container_v1beta1.types.ListNodePoolsRequest`): The request object. ListNodePoolsRequest lists the node pool(s) for a cluster. project_id (:class:`str`): @@ -1848,6 +1928,7 @@ async def list_node_pools( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1857,6 +1938,7 @@ async def list_node_pools( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1864,6 +1946,7 @@ async def list_node_pools( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1875,7 +1958,7 @@ async def list_node_pools( sent along with the request as metadata. Returns: - ~.cluster_service.ListNodePoolsResponse: + google.cloud.container_v1beta1.types.ListNodePoolsResponse: ListNodePoolsResponse is the result of ListNodePoolsRequest. @@ -1913,6 +1996,7 @@ async def list_node_pools( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -1944,7 +2028,7 @@ async def get_json_web_keys( available for all clusters. Args: - request (:class:`~.cluster_service.GetJSONWebKeysRequest`): + request (:class:`google.cloud.container_v1beta1.types.GetJSONWebKeysRequest`): The request object. GetJSONWebKeysRequest gets the public component of the keys used by the cluster to sign token requests. This will be the jwks_uri for the @@ -1958,7 +2042,7 @@ async def get_json_web_keys( sent along with the request as metadata. Returns: - ~.cluster_service.GetJSONWebKeysResponse: + google.cloud.container_v1beta1.types.GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 @@ -2003,7 +2087,7 @@ async def get_node_pool( r"""Retrieves the requested node pool. Args: - request (:class:`~.cluster_service.GetNodePoolRequest`): + request (:class:`google.cloud.container_v1beta1.types.GetNodePoolRequest`): The request object. GetNodePoolRequest retrieves a node pool for a cluster. project_id (:class:`str`): @@ -2012,6 +2096,7 @@ async def get_node_pool( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2021,6 +2106,7 @@ async def get_node_pool( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2028,6 +2114,7 @@ async def get_node_pool( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2036,6 +2123,7 @@ async def get_node_pool( node pool. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2047,7 +2135,7 @@ async def get_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.NodePool: + google.cloud.container_v1beta1.types.NodePool: NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. @@ -2095,6 +2183,7 @@ async def get_node_pool( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -2127,7 +2216,7 @@ async def create_node_pool( r"""Creates a node pool for a cluster. Args: - request (:class:`~.cluster_service.CreateNodePoolRequest`): + request (:class:`google.cloud.container_v1beta1.types.CreateNodePoolRequest`): The request object. CreateNodePoolRequest creates a node pool for a cluster. project_id (:class:`str`): @@ -2136,6 +2225,7 @@ async def create_node_pool( number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2145,6 +2235,7 @@ async def create_node_pool( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2152,10 +2243,11 @@ async def create_node_pool( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool (:class:`~.cluster_service.NodePool`): + node_pool (:class:`google.cloud.container_v1beta1.types.NodePool`): Required. The node pool to create. This corresponds to the ``node_pool`` field on the ``request`` instance; if ``request`` is provided, this @@ -2168,7 +2260,7 @@ async def create_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2234,7 +2326,7 @@ async def delete_node_pool( r"""Deletes a node pool from a cluster. Args: - request (:class:`~.cluster_service.DeleteNodePoolRequest`): + request (:class:`google.cloud.container_v1beta1.types.DeleteNodePoolRequest`): The request object. DeleteNodePoolRequest deletes a node pool for a cluster. project_id (:class:`str`): @@ -2243,6 +2335,7 @@ async def delete_node_pool( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2252,6 +2345,7 @@ async def delete_node_pool( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2259,6 +2353,7 @@ async def delete_node_pool( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2267,6 +2362,7 @@ async def delete_node_pool( node pool to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2278,7 +2374,7 @@ async def delete_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2320,6 +2416,7 @@ async def delete_node_pool( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -2354,7 +2451,7 @@ async def rollback_node_pool_upgrade( successfully completed. Args: - request (:class:`~.cluster_service.RollbackNodePoolUpgradeRequest`): + request (:class:`google.cloud.container_v1beta1.types.RollbackNodePoolUpgradeRequest`): The request object. RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed NodePool upgrade. This will be an no-op if the last upgrade @@ -2365,6 +2462,7 @@ async def rollback_node_pool_upgrade( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2374,6 +2472,7 @@ async def rollback_node_pool_upgrade( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2382,6 +2481,7 @@ async def rollback_node_pool_upgrade( cluster to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2390,6 +2490,7 @@ async def rollback_node_pool_upgrade( node pool to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2401,7 +2502,7 @@ async def rollback_node_pool_upgrade( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2468,7 +2569,7 @@ async def set_node_pool_management( r"""Sets the NodeManagement options for a node pool. Args: - request (:class:`~.cluster_service.SetNodePoolManagementRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetNodePoolManagementRequest`): The request object. SetNodePoolManagementRequest sets the node management properties of a node pool. project_id (:class:`str`): @@ -2477,6 +2578,7 @@ async def set_node_pool_management( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2486,6 +2588,7 @@ async def set_node_pool_management( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2494,6 +2597,7 @@ async def set_node_pool_management( cluster to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2502,12 +2606,14 @@ async def set_node_pool_management( node pool to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - management (:class:`~.cluster_service.NodeManagement`): + management (:class:`google.cloud.container_v1beta1.types.NodeManagement`): Required. NodeManagement configuration for the node pool. + This corresponds to the ``management`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2519,7 +2625,7 @@ async def set_node_pool_management( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2592,7 +2698,7 @@ async def set_labels( r"""Sets labels on a cluster. Args: - request (:class:`~.cluster_service.SetLabelsRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetLabelsRequest`): The request object. SetLabelsRequest sets the Google Cloud Platform labels on a Google Container Engine cluster, which will in turn set them for Google Compute @@ -2603,6 +2709,7 @@ async def set_labels( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2612,6 +2719,7 @@ async def set_labels( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2619,12 +2727,14 @@ async def set_labels( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - resource_labels (:class:`Sequence[~.cluster_service.SetLabelsRequest.ResourceLabelsEntry]`): + resource_labels (:class:`Sequence[google.cloud.container_v1beta1.types.SetLabelsRequest.ResourceLabelsEntry]`): Required. The labels to set for that cluster. + This corresponds to the ``resource_labels`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2637,6 +2747,7 @@ async def set_labels( fingerprint hash when updating or changing labels. Make a ``get()`` request to the resource to get the latest fingerprint. + This corresponds to the ``label_fingerprint`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2648,7 +2759,7 @@ async def set_labels( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2720,7 +2831,7 @@ async def set_legacy_abac( on a cluster. Args: - request (:class:`~.cluster_service.SetLegacyAbacRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetLegacyAbacRequest`): The request object. SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for a cluster. project_id (:class:`str`): @@ -2729,6 +2840,7 @@ async def set_legacy_abac( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2738,6 +2850,7 @@ async def set_legacy_abac( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2746,12 +2859,14 @@ async def set_legacy_abac( cluster to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. enabled (:class:`bool`): Required. Whether ABAC authorization will be enabled in the cluster. + This corresponds to the ``enabled`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2763,7 +2878,7 @@ async def set_legacy_abac( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2828,7 +2943,7 @@ async def start_ip_rotation( r"""Starts master IP rotation. Args: - request (:class:`~.cluster_service.StartIPRotationRequest`): + request (:class:`google.cloud.container_v1beta1.types.StartIPRotationRequest`): The request object. StartIPRotationRequest creates a new IP for the cluster and then performs a node upgrade on each node pool to point to the new IP. @@ -2838,6 +2953,7 @@ async def start_ip_rotation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2847,6 +2963,7 @@ async def start_ip_rotation( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2854,6 +2971,7 @@ async def start_ip_rotation( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2865,7 +2983,7 @@ async def start_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2928,7 +3046,7 @@ async def complete_ip_rotation( r"""Completes master IP rotation. Args: - request (:class:`~.cluster_service.CompleteIPRotationRequest`): + request (:class:`google.cloud.container_v1beta1.types.CompleteIPRotationRequest`): The request object. CompleteIPRotationRequest moves the cluster master back into single-IP mode. project_id (:class:`str`): @@ -2937,6 +3055,7 @@ async def complete_ip_rotation( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2946,6 +3065,7 @@ async def complete_ip_rotation( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2953,6 +3073,7 @@ async def complete_ip_rotation( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2964,7 +3085,7 @@ async def complete_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3024,7 +3145,7 @@ async def set_node_pool_size( r"""Sets the size for a specific node pool. Args: - request (:class:`~.cluster_service.SetNodePoolSizeRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetNodePoolSizeRequest`): The request object. SetNodePoolSizeRequest sets the size a node pool. @@ -3035,7 +3156,7 @@ async def set_node_pool_size( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3081,7 +3202,7 @@ async def set_network_policy( r"""Enables or disables Network Policy for a cluster. Args: - request (:class:`~.cluster_service.SetNetworkPolicyRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetNetworkPolicyRequest`): The request object. SetNetworkPolicyRequest enables/disables network policy for a cluster. project_id (:class:`str`): @@ -3090,6 +3211,7 @@ async def set_network_policy( number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3099,6 +3221,7 @@ async def set_network_policy( `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3106,12 +3229,14 @@ async def set_network_policy( Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - network_policy (:class:`~.cluster_service.NetworkPolicy`): + network_policy (:class:`google.cloud.container_v1beta1.types.NetworkPolicy`): Required. Configuration options for the NetworkPolicy feature. + This corresponds to the ``network_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3123,7 +3248,7 @@ async def set_network_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3189,13 +3314,14 @@ async def set_maintenance_policy( r"""Sets the maintenance policy for a cluster. Args: - request (:class:`~.cluster_service.SetMaintenancePolicyRequest`): + request (:class:`google.cloud.container_v1beta1.types.SetMaintenancePolicyRequest`): The request object. SetMaintenancePolicyRequest sets the maintenance policy for a cluster. project_id (:class:`str`): Required. The Google Developers Console `project ID or project number `__. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3203,19 +3329,22 @@ async def set_maintenance_policy( Required. The name of the Google Compute Engine `zone `__ in which the cluster resides. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. cluster_id (:class:`str`): Required. The name of the cluster to update. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - maintenance_policy (:class:`~.cluster_service.MaintenancePolicy`): + maintenance_policy (:class:`google.cloud.container_v1beta1.types.MaintenancePolicy`): Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy. + This corresponds to the ``maintenance_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3227,7 +3356,7 @@ async def set_maintenance_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3291,13 +3420,14 @@ async def list_usable_subnetworks( clusters in a project. Args: - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (:class:`google.cloud.container_v1beta1.types.ListUsableSubnetworksRequest`): The request object. ListUsableSubnetworksRequest requests the list of usable subnetworks. available to a user for creating clusters. parent (:class:`str`): Required. The parent project where subnetworks are usable. Specified in the format ``projects/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3309,7 +3439,7 @@ async def list_usable_subnetworks( sent along with the request as metadata. Returns: - ~.pagers.ListUsableSubnetworksAsyncPager: + google.cloud.container_v1beta1.services.cluster_manager.pagers.ListUsableSubnetworksAsyncPager: ListUsableSubnetworksResponse is the response of ListUsableSubnetworksRequest. @@ -3348,6 +3478,7 @@ async def list_usable_subnetworks( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, @@ -3384,12 +3515,13 @@ async def list_locations( Engine. Args: - request (:class:`~.cluster_service.ListLocationsRequest`): + request (:class:`google.cloud.container_v1beta1.types.ListLocationsRequest`): The request object. ListLocationsRequest is used to request the locations that offer GKE. parent (:class:`str`): Required. Contains the name of the resource requested. Specified in the format ``projects/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3401,7 +3533,7 @@ async def list_locations( sent along with the request as metadata. Returns: - ~.cluster_service.ListLocationsResponse: + google.cloud.container_v1beta1.types.ListLocationsResponse: ListLocationsResponse returns the list of all GKE locations and their recommendation state. @@ -3436,6 +3568,7 @@ async def list_locations( predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=DEFAULT_CLIENT_INFO, diff --git a/google/cloud/container_v1beta1/services/cluster_manager/client.py b/google/cloud/container_v1beta1/services/cluster_manager/client.py index af40fcf9..eea79a2b 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/client.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/client.py @@ -111,6 +111,22 @@ def _get_default_mtls_endpoint(api_endpoint): DEFAULT_ENDPOINT ) + @classmethod + def from_service_account_info(cls, info: dict, *args, **kwargs): + """Creates an instance of this client using the provided credentials info. + + Args: + info (dict): The service account private key info. + args: Additional arguments to pass to the constructor. + kwargs: Additional arguments to pass to the constructor. + + Returns: + ClusterManagerClient: The constructed client. + """ + credentials = service_account.Credentials.from_service_account_info(info) + kwargs["credentials"] = credentials + return cls(*args, **kwargs) + @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials @@ -123,7 +139,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): kwargs: Additional arguments to pass to the constructor. Returns: - {@api.name}: The constructed client. + ClusterManagerClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_file(filename) kwargs["credentials"] = credentials @@ -226,10 +242,10 @@ def __init__( credentials identify the application to the service; if none are specified, the client will attempt to ascertain the credentials from the environment. - transport (Union[str, ~.ClusterManagerTransport]): The + transport (Union[str, ClusterManagerTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (client_options_lib.ClientOptions): Custom options for the + client_options (google.api_core.client_options.ClientOptions): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -265,21 +281,17 @@ def __init__( util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false")) ) - ssl_credentials = None + client_cert_source_func = None is_mtls = False if use_client_cert: if client_options.client_cert_source: - import grpc # type: ignore - - cert, key = client_options.client_cert_source() - ssl_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) is_mtls = True + client_cert_source_func = client_options.client_cert_source else: - creds = SslCredentials() - is_mtls = creds.is_mtls - ssl_credentials = creds.ssl_credentials if is_mtls else None + is_mtls = mtls.has_default_client_cert_source() + client_cert_source_func = ( + mtls.default_client_cert_source() if is_mtls else None + ) # Figure out which api endpoint to use. if client_options.api_endpoint is not None: @@ -322,7 +334,7 @@ def __init__( credentials_file=client_options.credentials_file, host=api_endpoint, scopes=client_options.scopes, - ssl_channel_credentials=ssl_credentials, + client_cert_source_for_mtls=client_cert_source_func, quota_project_id=client_options.quota_project_id, client_info=client_info, ) @@ -341,24 +353,26 @@ def list_clusters( specified zone or all zones. Args: - request (:class:`~.cluster_service.ListClustersRequest`): + request (google.cloud.container_v1beta1.types.ListClustersRequest): The request object. ListClustersRequest lists clusters. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides, or "-" for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -370,7 +384,7 @@ def list_clusters( sent along with the request as metadata. Returns: - ~.cluster_service.ListClustersResponse: + google.cloud.container_v1beta1.types.ListClustersResponse: ListClustersResponse is the result of ListClustersRequest. @@ -430,32 +444,35 @@ def get_cluster( r"""Gets the details for a specific cluster. Args: - request (:class:`~.cluster_service.GetClusterRequest`): + request (google.cloud.container_v1beta1.types.GetClusterRequest): The request object. GetClusterRequest gets the settings of a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to retrieve. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -467,7 +484,7 @@ def get_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Cluster: + google.cloud.container_v1beta1.types.Cluster: A Google Kubernetes Engine cluster. """ # Create or coerce a protobuf request object. @@ -539,30 +556,33 @@ def create_cluster( indicating which CIDR range the cluster is using. Args: - request (:class:`~.cluster_service.CreateClusterRequest`): + request (google.cloud.container_v1beta1.types.CreateClusterRequest): The request object. CreateClusterRequest creates a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (:class:`~.cluster_service.Cluster`): + cluster (google.cloud.container_v1beta1.types.Cluster): Required. A `cluster resource `__ + This corresponds to the ``cluster`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -574,7 +594,7 @@ def create_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -639,38 +659,42 @@ def update_cluster( r"""Updates the settings for a specific cluster. Args: - request (:class:`~.cluster_service.UpdateClusterRequest`): + request (google.cloud.container_v1beta1.types.UpdateClusterRequest): The request object. UpdateClusterRequest updates the settings of a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - update (:class:`~.cluster_service.ClusterUpdate`): + update (google.cloud.container_v1beta1.types.ClusterUpdate): Required. A description of the update. + This corresponds to the ``update`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -682,7 +706,7 @@ def update_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -746,7 +770,7 @@ def update_node_pool( node pool. Args: - request (:class:`~.cluster_service.UpdateNodePoolRequest`): + request (google.cloud.container_v1beta1.types.UpdateNodePoolRequest): The request object. SetNodePoolVersionRequest updates the version of a node pool. @@ -757,7 +781,7 @@ def update_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -801,7 +825,7 @@ def set_node_pool_autoscaling( pool. Args: - request (:class:`~.cluster_service.SetNodePoolAutoscalingRequest`): + request (google.cloud.container_v1beta1.types.SetNodePoolAutoscalingRequest): The request object. SetNodePoolAutoscalingRequest sets the autoscaler settings of a node pool. @@ -812,7 +836,7 @@ def set_node_pool_autoscaling( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -861,36 +885,39 @@ def set_logging_service( r"""Sets the logging service for a specific cluster. Args: - request (:class:`~.cluster_service.SetLoggingServiceRequest`): + request (google.cloud.container_v1beta1.types.SetLoggingServiceRequest): The request object. SetLoggingServiceRequest sets the logging service of a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - logging_service (:class:`str`): + logging_service (str): Required. The logging service the cluster should use to write logs. Currently available options: @@ -905,6 +932,7 @@ def set_logging_service( string,\ ``logging.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``logging.googleapis.com`` for earlier versions. + This corresponds to the ``logging_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -916,7 +944,7 @@ def set_logging_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -983,36 +1011,39 @@ def set_monitoring_service( r"""Sets the monitoring service for a specific cluster. Args: - request (:class:`~.cluster_service.SetMonitoringServiceRequest`): + request (google.cloud.container_v1beta1.types.SetMonitoringServiceRequest): The request object. SetMonitoringServiceRequest sets the monitoring service of a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - monitoring_service (:class:`str`): + monitoring_service (str): Required. The monitoring service the cluster should use to write metrics. Currently available options: @@ -1029,6 +1060,7 @@ def set_monitoring_service( string,\ ``monitoring.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``monitoring.googleapis.com`` for earlier versions. + This corresponds to the ``monitoring_service`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1040,7 +1072,7 @@ def set_monitoring_service( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1107,39 +1139,43 @@ def set_addons_config( r"""Sets the addons for a specific cluster. Args: - request (:class:`~.cluster_service.SetAddonsConfigRequest`): + request (google.cloud.container_v1beta1.types.SetAddonsConfigRequest): The request object. SetAddonsRequest sets the addons associated with the cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - addons_config (:class:`~.cluster_service.AddonsConfig`): + addons_config (google.cloud.container_v1beta1.types.AddonsConfig): Required. The desired configurations for the various addons available to run in the cluster. + This corresponds to the ``addons_config`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1151,7 +1187,7 @@ def set_addons_config( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1220,36 +1256,39 @@ def set_locations( instead. Args: - request (:class:`~.cluster_service.SetLocationsRequest`): + request (google.cloud.container_v1beta1.types.SetLocationsRequest): The request object. SetLocationsRequest sets the locations of the cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - locations (:class:`Sequence[str]`): + locations (Sequence[str]): Required. The desired list of Google Compute Engine `zones `__ in which the cluster's nodes should be located. Changing @@ -1259,6 +1298,7 @@ def set_locations( This list must always include the cluster's primary zone. + This corresponds to the ``locations`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1270,7 +1310,7 @@ def set_locations( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1303,9 +1343,8 @@ def set_locations( request.zone = zone if cluster_id is not None: request.cluster_id = cluster_id - - if locations: - request.locations.extend(locations) + if locations is not None: + request.locations = locations # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1338,36 +1377,39 @@ def update_master( r"""Updates the master for a specific cluster. Args: - request (:class:`~.cluster_service.UpdateMasterRequest`): + request (google.cloud.container_v1beta1.types.UpdateMasterRequest): The request object. UpdateMasterRequest updates the master of the cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - master_version (:class:`str`): + master_version (str): Required. The Kubernetes version to change the master to. Users may specify either explicit @@ -1382,6 +1424,7 @@ def update_master( "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the default Kubernetes version + This corresponds to the ``master_version`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1393,7 +1436,7 @@ def update_master( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1459,7 +1502,7 @@ def set_master_auth( password. Args: - request (:class:`~.cluster_service.SetMasterAuthRequest`): + request (google.cloud.container_v1beta1.types.SetMasterAuthRequest): The request object. SetMasterAuthRequest updates the admin password of a cluster. @@ -1470,7 +1513,7 @@ def set_master_auth( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1525,32 +1568,35 @@ def delete_cluster( initially created. Args: - request (:class:`~.cluster_service.DeleteClusterRequest`): + request (google.cloud.container_v1beta1.types.DeleteClusterRequest): The request object. DeleteClusterRequest deletes a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1562,7 +1608,7 @@ def delete_cluster( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1626,25 +1672,27 @@ def list_operations( zone or all zones. Args: - request (:class:`~.cluster_service.ListOperationsRequest`): + request (google.cloud.container_v1beta1.types.ListOperationsRequest): The request object. ListOperationsRequest lists operations. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ to return operations for, or ``-`` for all zones. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1656,7 +1704,7 @@ def list_operations( sent along with the request as metadata. Returns: - ~.cluster_service.ListOperationsResponse: + google.cloud.container_v1beta1.types.ListOperationsResponse: ListOperationsResponse is the result of ListOperationsRequest. @@ -1716,31 +1764,34 @@ def get_operation( r"""Gets the specified operation. Args: - request (:class:`~.cluster_service.GetOperationRequest`): + request (google.cloud.container_v1beta1.types.GetOperationRequest): The request object. GetOperationRequest gets a single operation. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - operation_id (:class:`str`): + operation_id (str): Required. Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1752,7 +1803,7 @@ def get_operation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -1816,31 +1867,34 @@ def cancel_operation( r"""Cancels the specified operation. Args: - request (:class:`~.cluster_service.CancelOperationRequest`): + request (google.cloud.container_v1beta1.types.CancelOperationRequest): The request object. CancelOperationRequest cancels a single operation. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the operation resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - operation_id (:class:`str`): + operation_id (str): Required. Deprecated. The server-assigned ``name`` of the operation. This field has been deprecated and replaced by the name field. + This corresponds to the ``operation_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1907,24 +1961,26 @@ def get_server_config( Kubernetes Engine service. Args: - request (:class:`~.cluster_service.GetServerConfigRequest`): + request (google.cloud.container_v1beta1.types.GetServerConfigRequest): The request object. Gets the current Kubernetes Engine service configuration. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ to return operations for. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -1936,7 +1992,7 @@ def get_server_config( sent along with the request as metadata. Returns: - ~.cluster_service.ServerConfig: + google.cloud.container_v1beta1.types.ServerConfig: Kubernetes Engine service configuration. @@ -1996,31 +2052,34 @@ def list_node_pools( r"""Lists the node pools for a cluster. Args: - request (:class:`~.cluster_service.ListNodePoolsRequest`): + request (google.cloud.container_v1beta1.types.ListNodePoolsRequest): The request object. ListNodePoolsRequest lists the node pool(s) for a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2032,7 +2091,7 @@ def list_node_pools( sent along with the request as metadata. Returns: - ~.cluster_service.ListNodePoolsResponse: + google.cloud.container_v1beta1.types.ListNodePoolsResponse: ListNodePoolsResponse is the result of ListNodePoolsRequest. @@ -2094,7 +2153,7 @@ def get_json_web_keys( available for all clusters. Args: - request (:class:`~.cluster_service.GetJSONWebKeysRequest`): + request (google.cloud.container_v1beta1.types.GetJSONWebKeysRequest): The request object. GetJSONWebKeysRequest gets the public component of the keys used by the cluster to sign token requests. This will be the jwks_uri for the @@ -2108,7 +2167,7 @@ def get_json_web_keys( sent along with the request as metadata. Returns: - ~.cluster_service.GetJSONWebKeysResponse: + google.cloud.container_v1beta1.types.GetJSONWebKeysResponse: GetJSONWebKeysResponse is a valid JSON Web Key Set as specififed in rfc 7517 @@ -2154,39 +2213,43 @@ def get_node_pool( r"""Retrieves the requested node pool. Args: - request (:class:`~.cluster_service.GetNodePoolRequest`): + request (google.cloud.container_v1beta1.types.GetNodePoolRequest): The request object. GetNodePoolRequest retrieves a node pool for a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Required. Deprecated. The name of the node pool. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2198,7 +2261,7 @@ def get_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.NodePool: + google.cloud.container_v1beta1.types.NodePool: NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. @@ -2271,35 +2334,38 @@ def create_node_pool( r"""Creates a node pool for a cluster. Args: - request (:class:`~.cluster_service.CreateNodePoolRequest`): + request (google.cloud.container_v1beta1.types.CreateNodePoolRequest): The request object. CreateNodePoolRequest creates a node pool for a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the parent field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool (:class:`~.cluster_service.NodePool`): + node_pool (google.cloud.container_v1beta1.types.NodePool): Required. The node pool to create. This corresponds to the ``node_pool`` field on the ``request`` instance; if ``request`` is provided, this @@ -2312,7 +2378,7 @@ def create_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2379,39 +2445,43 @@ def delete_node_pool( r"""Deletes a node pool from a cluster. Args: - request (:class:`~.cluster_service.DeleteNodePoolRequest`): + request (google.cloud.container_v1beta1.types.DeleteNodePoolRequest): The request object. DeleteNodePoolRequest deletes a node pool for a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Required. Deprecated. The name of the node pool to delete. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2423,7 +2493,7 @@ def delete_node_pool( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2492,42 +2562,46 @@ def rollback_node_pool_upgrade( successfully completed. Args: - request (:class:`~.cluster_service.RollbackNodePoolUpgradeRequest`): + request (google.cloud.container_v1beta1.types.RollbackNodePoolUpgradeRequest): The request object. RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed NodePool upgrade. This will be an no-op if the last upgrade successfully completed. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Required. Deprecated. The name of the node pool to rollback. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2539,7 +2613,7 @@ def rollback_node_pool_upgrade( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2609,46 +2683,51 @@ def set_node_pool_management( r"""Sets the NodeManagement options for a node pool. Args: - request (:class:`~.cluster_service.SetNodePoolManagementRequest`): + request (google.cloud.container_v1beta1.types.SetNodePoolManagementRequest): The request object. SetNodePoolManagementRequest sets the node management properties of a node pool. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - node_pool_id (:class:`str`): + node_pool_id (str): Required. Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``node_pool_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - management (:class:`~.cluster_service.NodeManagement`): + management (google.cloud.container_v1beta1.types.NodeManagement): Required. NodeManagement configuration for the node pool. + This corresponds to the ``management`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2660,7 +2739,7 @@ def set_node_pool_management( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2734,43 +2813,47 @@ def set_labels( r"""Sets labels on a cluster. Args: - request (:class:`~.cluster_service.SetLabelsRequest`): + request (google.cloud.container_v1beta1.types.SetLabelsRequest): The request object. SetLabelsRequest sets the Google Cloud Platform labels on a Google Container Engine cluster, which will in turn set them for Google Compute Engine resources used by that cluster - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - resource_labels (:class:`Sequence[~.cluster_service.SetLabelsRequest.ResourceLabelsEntry]`): + resource_labels (Sequence[google.cloud.container_v1beta1.types.SetLabelsRequest.ResourceLabelsEntry]): Required. The labels to set for that cluster. + This corresponds to the ``resource_labels`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - label_fingerprint (:class:`str`): + label_fingerprint (str): Required. The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Kubernetes Engine @@ -2779,6 +2862,7 @@ def set_labels( fingerprint hash when updating or changing labels. Make a ``get()`` request to the resource to get the latest fingerprint. + This corresponds to the ``label_fingerprint`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2790,7 +2874,7 @@ def set_labels( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2825,12 +2909,11 @@ def set_labels( request.zone = zone if cluster_id is not None: request.cluster_id = cluster_id + if resource_labels is not None: + request.resource_labels = resource_labels if label_fingerprint is not None: request.label_fingerprint = label_fingerprint - if resource_labels: - request.resource_labels.update(resource_labels) - # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = self._transport._wrapped_methods[self._transport.set_labels] @@ -2863,38 +2946,42 @@ def set_legacy_abac( on a cluster. Args: - request (:class:`~.cluster_service.SetLegacyAbacRequest`): + request (google.cloud.container_v1beta1.types.SetLegacyAbacRequest): The request object. SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster to update. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - enabled (:class:`bool`): + enabled (bool): Required. Whether ABAC authorization will be enabled in the cluster. + This corresponds to the ``enabled`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -2906,7 +2993,7 @@ def set_legacy_abac( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -2972,32 +3059,35 @@ def start_ip_rotation( r"""Starts master IP rotation. Args: - request (:class:`~.cluster_service.StartIPRotationRequest`): + request (google.cloud.container_v1beta1.types.StartIPRotationRequest): The request object. StartIPRotationRequest creates a new IP for the cluster and then performs a node upgrade on each node pool to point to the new IP. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3009,7 +3099,7 @@ def start_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3073,31 +3163,34 @@ def complete_ip_rotation( r"""Completes master IP rotation. Args: - request (:class:`~.cluster_service.CompleteIPRotationRequest`): + request (google.cloud.container_v1beta1.types.CompleteIPRotationRequest): The request object. CompleteIPRotationRequest moves the cluster master back into single-IP mode. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3109,7 +3202,7 @@ def complete_ip_rotation( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3170,7 +3263,7 @@ def set_node_pool_size( r"""Sets the size for a specific node pool. Args: - request (:class:`~.cluster_service.SetNodePoolSizeRequest`): + request (google.cloud.container_v1beta1.types.SetNodePoolSizeRequest): The request object. SetNodePoolSizeRequest sets the size a node pool. @@ -3181,7 +3274,7 @@ def set_node_pool_size( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3228,37 +3321,41 @@ def set_network_policy( r"""Enables or disables Network Policy for a cluster. Args: - request (:class:`~.cluster_service.SetNetworkPolicyRequest`): + request (google.cloud.container_v1beta1.types.SetNetworkPolicyRequest): The request object. SetNetworkPolicyRequest enables/disables network policy for a cluster. - project_id (:class:`str`): + project_id (str): Required. Deprecated. The Google Developers Console `project ID or project number `__. This field has been deprecated and replaced by the name field. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. Deprecated. The name of the Google Compute Engine `zone `__ in which the cluster resides. This field has been deprecated and replaced by the name field. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - network_policy (:class:`~.cluster_service.NetworkPolicy`): + network_policy (google.cloud.container_v1beta1.types.NetworkPolicy): Required. Configuration options for the NetworkPolicy feature. + This corresponds to the ``network_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3270,7 +3367,7 @@ def set_network_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3337,33 +3434,37 @@ def set_maintenance_policy( r"""Sets the maintenance policy for a cluster. Args: - request (:class:`~.cluster_service.SetMaintenancePolicyRequest`): + request (google.cloud.container_v1beta1.types.SetMaintenancePolicyRequest): The request object. SetMaintenancePolicyRequest sets the maintenance policy for a cluster. - project_id (:class:`str`): + project_id (str): Required. The Google Developers Console `project ID or project number `__. + This corresponds to the ``project_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - zone (:class:`str`): + zone (str): Required. The name of the Google Compute Engine `zone `__ in which the cluster resides. + This corresponds to the ``zone`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster_id (:class:`str`): + cluster_id (str): Required. The name of the cluster to update. + This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - maintenance_policy (:class:`~.cluster_service.MaintenancePolicy`): + maintenance_policy (google.cloud.container_v1beta1.types.MaintenancePolicy): Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy. + This corresponds to the ``maintenance_policy`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3375,7 +3476,7 @@ def set_maintenance_policy( sent along with the request as metadata. Returns: - ~.cluster_service.Operation: + google.cloud.container_v1beta1.types.Operation: This operation resource represents operations that may have happened or are happening on the cluster. All fields are @@ -3440,13 +3541,14 @@ def list_usable_subnetworks( clusters in a project. Args: - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (google.cloud.container_v1beta1.types.ListUsableSubnetworksRequest): The request object. ListUsableSubnetworksRequest requests the list of usable subnetworks. available to a user for creating clusters. - parent (:class:`str`): + parent (str): Required. The parent project where subnetworks are usable. Specified in the format ``projects/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3458,7 +3560,7 @@ def list_usable_subnetworks( sent along with the request as metadata. Returns: - ~.pagers.ListUsableSubnetworksPager: + google.cloud.container_v1beta1.services.cluster_manager.pagers.ListUsableSubnetworksPager: ListUsableSubnetworksResponse is the response of ListUsableSubnetworksRequest. @@ -3526,12 +3628,13 @@ def list_locations( Engine. Args: - request (:class:`~.cluster_service.ListLocationsRequest`): + request (google.cloud.container_v1beta1.types.ListLocationsRequest): The request object. ListLocationsRequest is used to request the locations that offer GKE. - parent (:class:`str`): + parent (str): Required. Contains the name of the resource requested. Specified in the format ``projects/*``. + This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. @@ -3543,7 +3646,7 @@ def list_locations( sent along with the request as metadata. Returns: - ~.cluster_service.ListLocationsResponse: + google.cloud.container_v1beta1.types.ListLocationsResponse: ListLocationsResponse returns the list of all GKE locations and their recommendation state. diff --git a/google/cloud/container_v1beta1/services/cluster_manager/pagers.py b/google/cloud/container_v1beta1/services/cluster_manager/pagers.py index cd8bb39d..3967c955 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/pagers.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/pagers.py @@ -15,7 +15,16 @@ # limitations under the License. # -from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Sequence, Tuple +from typing import ( + Any, + AsyncIterable, + Awaitable, + Callable, + Iterable, + Sequence, + Tuple, + Optional, +) from google.cloud.container_v1beta1.types import cluster_service @@ -24,7 +33,7 @@ class ListUsableSubnetworksPager: """A pager for iterating through ``list_usable_subnetworks`` requests. This class thinly wraps an initial - :class:`~.cluster_service.ListUsableSubnetworksResponse` object, and + :class:`google.cloud.container_v1beta1.types.ListUsableSubnetworksResponse` object, and provides an ``__iter__`` method to iterate through its ``subnetworks`` field. @@ -33,7 +42,7 @@ class ListUsableSubnetworksPager: through the ``subnetworks`` field on the corresponding responses. - All the usual :class:`~.cluster_service.ListUsableSubnetworksResponse` + All the usual :class:`google.cloud.container_v1beta1.types.ListUsableSubnetworksResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -51,9 +60,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (google.cloud.container_v1beta1.types.ListUsableSubnetworksRequest): The initial request object. - response (:class:`~.cluster_service.ListUsableSubnetworksResponse`): + response (google.cloud.container_v1beta1.types.ListUsableSubnetworksResponse): The initial response object. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. @@ -86,7 +95,7 @@ class ListUsableSubnetworksAsyncPager: """A pager for iterating through ``list_usable_subnetworks`` requests. This class thinly wraps an initial - :class:`~.cluster_service.ListUsableSubnetworksResponse` object, and + :class:`google.cloud.container_v1beta1.types.ListUsableSubnetworksResponse` object, and provides an ``__aiter__`` method to iterate through its ``subnetworks`` field. @@ -95,7 +104,7 @@ class ListUsableSubnetworksAsyncPager: through the ``subnetworks`` field on the corresponding responses. - All the usual :class:`~.cluster_service.ListUsableSubnetworksResponse` + All the usual :class:`google.cloud.container_v1beta1.types.ListUsableSubnetworksResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -113,9 +122,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (:class:`~.cluster_service.ListUsableSubnetworksRequest`): + request (google.cloud.container_v1beta1.types.ListUsableSubnetworksRequest): The initial request object. - response (:class:`~.cluster_service.ListUsableSubnetworksResponse`): + response (google.cloud.container_v1beta1.types.ListUsableSubnetworksResponse): The initial response object. metadata (Sequence[Tuple[str, str]]): Strings which should be sent along with the request as metadata. diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py index 055667ac..3c51f6d5 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py @@ -68,10 +68,10 @@ def __init__( scope (Optional[Sequence[str]]): A list of scopes. quota_project_id (Optional[str]): An optional project to use for billing and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. """ # Save the hostname. Default to port 443 (HTTPS) if none is specified. @@ -79,6 +79,9 @@ def __init__( host += ":443" self._host = host + # Save the scopes. + self._scopes = scopes or self.AUTH_SCOPES + # If no credentials are provided, then determine the appropriate # defaults. if credentials and credentials_file: @@ -88,20 +91,17 @@ def __init__( if credentials_file is not None: credentials, _ = auth.load_credentials_from_file( - credentials_file, scopes=scopes, quota_project_id=quota_project_id + credentials_file, scopes=self._scopes, quota_project_id=quota_project_id ) elif credentials is None: credentials, _ = auth.default( - scopes=scopes, quota_project_id=quota_project_id + scopes=self._scopes, quota_project_id=quota_project_id ) # Save the credentials. self._credentials = credentials - # Lifted into its own function so it can be stubbed out during tests. - self._prep_wrapped_messages(client_info) - def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { @@ -114,6 +114,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -127,6 +128,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -174,6 +176,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -187,6 +190,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -200,6 +204,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -216,6 +221,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -229,6 +235,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -245,6 +252,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -261,6 +269,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -309,6 +318,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, @@ -322,6 +332,7 @@ def _prep_wrapped_messages(self, client_info): predicate=retries.if_exception_type( exceptions.DeadlineExceeded, exceptions.ServiceUnavailable, ), + deadline=20.0, ), default_timeout=20.0, client_info=client_info, diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py index 4c538ffb..65264465 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py @@ -58,6 +58,7 @@ def __init__( api_mtls_endpoint: str = None, client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: @@ -88,6 +89,10 @@ def __init__( ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials for grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. client_info (google.api_core.gapic_v1.client_info.ClientInfo): @@ -102,72 +107,60 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) if channel: - # Sanity check: Ensure that channel and credentials are not both - # provided. + # Ignore credentials if a channel was passed. credentials = False - # If a channel was explicitly provided, set it. self._grpc_channel = channel self._ssl_channel_credentials = None - elif api_mtls_endpoint: - warnings.warn( - "api_mtls_endpoint and client_cert_source are deprecated", - DeprecationWarning, - ) - host = ( - api_mtls_endpoint - if ":" in api_mtls_endpoint - else api_mtls_endpoint + ":443" - ) + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) - - # Create SSL credentials with client_cert_source or application - # default SSL credentials. - if client_cert_source: - cert, key = client_cert_source() - ssl_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) else: - ssl_credentials = SslCredentials().ssl_credentials - - # create a new channel. The provided one is ignored. - self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, - credentials_file=credentials_file, - ssl_credentials=ssl_credentials, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - self._ssl_channel_credentials = ssl_credentials - else: - host = host if ":" in host else host + ":443" + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + ) - # create a new channel. The provided one is ignored. + if not self._grpc_channel: self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, + self._host, + credentials=self._credentials, credentials_file=credentials_file, - ssl_credentials=ssl_channel_credentials, - scopes=scopes or self.AUTH_SCOPES, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, options=[ ("grpc.max_send_message_length", -1), @@ -175,17 +168,8 @@ def __init__( ], ) - self._stubs = {} # type: Dict[str, Callable] - - # Run the base constructor. - super().__init__( - host=host, - credentials=credentials, - credentials_file=credentials_file, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - client_info=client_info, - ) + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) @classmethod def create_channel( @@ -199,7 +183,7 @@ def create_channel( ) -> grpc.Channel: """Create and return a gRPC channel object. Args: - address (Optional[str]): The host for the channel to use. + host (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If diff --git a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py index 368aa383..0d431fc2 100644 --- a/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py +++ b/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py @@ -62,7 +62,7 @@ def create_channel( ) -> aio.Channel: """Create and return a gRPC AsyncIO channel object. Args: - address (Optional[str]): The host for the channel to use. + host (Optional[str]): The host for the channel to use. credentials (Optional[~.Credentials]): The authorization credentials to attach to requests. These credentials identify this application to the service. If @@ -102,6 +102,7 @@ def __init__( api_mtls_endpoint: str = None, client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, ssl_channel_credentials: grpc.ChannelCredentials = None, + client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, quota_project_id=None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: @@ -133,12 +134,16 @@ def __init__( ``api_mtls_endpoint`` is None. ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials for grpc channel. It is ignored if ``channel`` is provided. + client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]): + A callback to provide client certificate bytes and private key bytes, + both in PEM format. It is used to configure mutual TLS channel. It is + ignored if ``channel`` or ``ssl_channel_credentials`` is provided. quota_project_id (Optional[str]): An optional project to use for billing and quota. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing your own client library. Raises: @@ -147,72 +152,60 @@ def __init__( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ + self._grpc_channel = None self._ssl_channel_credentials = ssl_channel_credentials + self._stubs: Dict[str, Callable] = {} + + if api_mtls_endpoint: + warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning) + if client_cert_source: + warnings.warn("client_cert_source is deprecated", DeprecationWarning) if channel: - # Sanity check: Ensure that channel and credentials are not both - # provided. + # Ignore credentials if a channel was passed. credentials = False - # If a channel was explicitly provided, set it. self._grpc_channel = channel self._ssl_channel_credentials = None - elif api_mtls_endpoint: - warnings.warn( - "api_mtls_endpoint and client_cert_source are deprecated", - DeprecationWarning, - ) - host = ( - api_mtls_endpoint - if ":" in api_mtls_endpoint - else api_mtls_endpoint + ":443" - ) + else: + if api_mtls_endpoint: + host = api_mtls_endpoint + + # Create SSL credentials with client_cert_source or application + # default SSL credentials. + if client_cert_source: + cert, key = client_cert_source() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) + else: + self._ssl_channel_credentials = SslCredentials().ssl_credentials - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) - - # Create SSL credentials with client_cert_source or application - # default SSL credentials. - if client_cert_source: - cert, key = client_cert_source() - ssl_credentials = grpc.ssl_channel_credentials( - certificate_chain=cert, private_key=key - ) else: - ssl_credentials = SslCredentials().ssl_credentials - - # create a new channel. The provided one is ignored. - self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, - credentials_file=credentials_file, - ssl_credentials=ssl_credentials, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - options=[ - ("grpc.max_send_message_length", -1), - ("grpc.max_receive_message_length", -1), - ], - ) - self._ssl_channel_credentials = ssl_credentials - else: - host = host if ":" in host else host + ":443" + if client_cert_source_for_mtls and not ssl_channel_credentials: + cert, key = client_cert_source_for_mtls() + self._ssl_channel_credentials = grpc.ssl_channel_credentials( + certificate_chain=cert, private_key=key + ) - if credentials is None: - credentials, _ = auth.default( - scopes=self.AUTH_SCOPES, quota_project_id=quota_project_id - ) + # The base transport sets the host, credentials and scopes + super().__init__( + host=host, + credentials=credentials, + credentials_file=credentials_file, + scopes=scopes, + quota_project_id=quota_project_id, + client_info=client_info, + ) - # create a new channel. The provided one is ignored. + if not self._grpc_channel: self._grpc_channel = type(self).create_channel( - host, - credentials=credentials, + self._host, + credentials=self._credentials, credentials_file=credentials_file, - ssl_credentials=ssl_channel_credentials, - scopes=scopes or self.AUTH_SCOPES, + scopes=self._scopes, + ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, options=[ ("grpc.max_send_message_length", -1), @@ -220,17 +213,8 @@ def __init__( ], ) - # Run the base constructor. - super().__init__( - host=host, - credentials=credentials, - credentials_file=credentials_file, - scopes=scopes or self.AUTH_SCOPES, - quota_project_id=quota_project_id, - client_info=client_info, - ) - - self._stubs = {} + # Wrap messages. This must be done after self._grpc_channel exists + self._prep_wrapped_messages(client_info) @property def grpc_channel(self) -> aio.Channel: diff --git a/google/cloud/container_v1beta1/types/__init__.py b/google/cloud/container_v1beta1/types/__init__.py index 204352e3..90863492 100644 --- a/google/cloud/container_v1beta1/types/__init__.py +++ b/google/cloud/container_v1beta1/types/__init__.py @@ -16,233 +16,233 @@ # from .cluster_service import ( - LinuxNodeConfig, - NodeKubeletConfig, - NodeConfig, - ShieldedInstanceConfig, - SandboxConfig, - EphemeralStorageConfig, - ReservationAffinity, - NodeTaint, - MasterAuth, - ClientCertificateConfig, + AcceleratorConfig, AddonsConfig, - HttpLoadBalancing, - HorizontalPodAutoscaling, - KubernetesDashboard, - NetworkPolicyConfig, - DnsCacheConfig, - KalmConfig, - ConfigConnectorConfig, - GcePersistentDiskCsiDriverConfig, - PrivateClusterMasterGlobalAccessConfig, - PrivateClusterConfig, - IstioConfig, - CloudRunConfig, - MasterAuthorizedNetworksConfig, - LegacyAbac, - NetworkPolicy, - IPAllocationPolicy, - BinaryAuthorization, - PodSecurityPolicyConfig, AuthenticatorGroupsConfig, - ClusterTelemetry, + AutoprovisioningNodePoolDefaults, + AutoUpgradeOptions, + BinaryAuthorization, + CancelOperationRequest, + ClientCertificateConfig, + CloudRunConfig, Cluster, + ClusterAutoscaling, + ClusterTelemetry, ClusterUpdate, - Operation, - OperationProgress, + CompleteIPRotationRequest, + ConfidentialNodes, + ConfigConnectorConfig, CreateClusterRequest, - GetClusterRequest, - UpdateClusterRequest, - UpdateNodePoolRequest, - SetNodePoolAutoscalingRequest, - SetLoggingServiceRequest, - SetMonitoringServiceRequest, - SetAddonsConfigRequest, - SetLocationsRequest, - UpdateMasterRequest, - SetMasterAuthRequest, + CreateNodePoolRequest, + DailyMaintenanceWindow, + DatabaseEncryption, + DefaultSnatStatus, DeleteClusterRequest, + DeleteNodePoolRequest, + DnsCacheConfig, + EphemeralStorageConfig, + GcePersistentDiskCsiDriverConfig, + GetClusterRequest, + GetJSONWebKeysRequest, + GetJSONWebKeysResponse, + GetNodePoolRequest, + GetOpenIDConfigRequest, + GetOpenIDConfigResponse, + GetOperationRequest, + GetServerConfigRequest, + HorizontalPodAutoscaling, + HttpLoadBalancing, + IntraNodeVisibilityConfig, + IPAllocationPolicy, + IstioConfig, + Jwk, + KalmConfig, + KubernetesDashboard, + LegacyAbac, + LinuxNodeConfig, ListClustersRequest, ListClustersResponse, - GetOperationRequest, + ListLocationsRequest, + ListLocationsResponse, + ListNodePoolsRequest, + ListNodePoolsResponse, ListOperationsRequest, - CancelOperationRequest, ListOperationsResponse, - GetServerConfigRequest, - ServerConfig, - CreateNodePoolRequest, - DeleteNodePoolRequest, - ListNodePoolsRequest, - GetNodePoolRequest, - NodePool, - NodeManagement, - AutoUpgradeOptions, + ListUsableSubnetworksRequest, + ListUsableSubnetworksResponse, + Location, MaintenancePolicy, MaintenanceWindow, - TimeWindow, + Master, + MasterAuth, + MasterAuthorizedNetworksConfig, + MaxPodsConstraint, + NetworkConfig, + NetworkPolicy, + NetworkPolicyConfig, + NodeConfig, + NodeKubeletConfig, + NodeManagement, + NodePool, + NodePoolAutoscaling, + NodeTaint, + NotificationConfig, + Operation, + OperationProgress, + PodSecurityPolicyConfig, + PrivateClusterConfig, + PrivateClusterMasterGlobalAccessConfig, RecurringTimeWindow, - DailyMaintenanceWindow, - SetNodePoolManagementRequest, - SetNodePoolSizeRequest, - RollbackNodePoolUpgradeRequest, - ListNodePoolsResponse, - ClusterAutoscaling, - AutoprovisioningNodePoolDefaults, + ReleaseChannel, + ReservationAffinity, ResourceLimit, - NodePoolAutoscaling, + ResourceUsageExportConfig, + RollbackNodePoolUpgradeRequest, + SandboxConfig, + ServerConfig, + SetAddonsConfigRequest, SetLabelsRequest, SetLegacyAbacRequest, - StartIPRotationRequest, - CompleteIPRotationRequest, - AcceleratorConfig, - WorkloadMetadataConfig, - SetNetworkPolicyRequest, + SetLocationsRequest, + SetLoggingServiceRequest, SetMaintenancePolicyRequest, - ListLocationsRequest, - ListLocationsResponse, - Location, + SetMasterAuthRequest, + SetMonitoringServiceRequest, + SetNetworkPolicyRequest, + SetNodePoolAutoscalingRequest, + SetNodePoolManagementRequest, + SetNodePoolSizeRequest, + ShieldedInstanceConfig, + ShieldedNodes, + StartIPRotationRequest, StatusCondition, - NetworkConfig, - ListUsableSubnetworksRequest, - ListUsableSubnetworksResponse, - UsableSubnetworkSecondaryRange, + TimeWindow, + TpuConfig, + UpdateClusterRequest, + UpdateMasterRequest, + UpdateNodePoolRequest, + UpgradeEvent, UsableSubnetwork, + UsableSubnetworkSecondaryRange, VerticalPodAutoscaling, - DefaultSnatStatus, - IntraNodeVisibilityConfig, - MaxPodsConstraint, WorkloadIdentityConfig, - DatabaseEncryption, - ResourceUsageExportConfig, - ShieldedNodes, - GetOpenIDConfigRequest, - GetOpenIDConfigResponse, - GetJSONWebKeysRequest, - Jwk, - GetJSONWebKeysResponse, - ReleaseChannel, - TpuConfig, - Master, - NotificationConfig, - ConfidentialNodes, - UpgradeEvent, + WorkloadMetadataConfig, DatapathProvider, UpgradeResourceType, ) __all__ = ( - "LinuxNodeConfig", - "NodeKubeletConfig", - "NodeConfig", - "ShieldedInstanceConfig", - "SandboxConfig", - "EphemeralStorageConfig", - "ReservationAffinity", - "NodeTaint", - "MasterAuth", - "ClientCertificateConfig", + "AcceleratorConfig", "AddonsConfig", - "HttpLoadBalancing", - "HorizontalPodAutoscaling", - "KubernetesDashboard", - "NetworkPolicyConfig", - "DnsCacheConfig", - "KalmConfig", - "ConfigConnectorConfig", - "GcePersistentDiskCsiDriverConfig", - "PrivateClusterMasterGlobalAccessConfig", - "PrivateClusterConfig", - "IstioConfig", - "CloudRunConfig", - "MasterAuthorizedNetworksConfig", - "LegacyAbac", - "NetworkPolicy", - "IPAllocationPolicy", - "BinaryAuthorization", - "PodSecurityPolicyConfig", "AuthenticatorGroupsConfig", - "ClusterTelemetry", + "AutoprovisioningNodePoolDefaults", + "AutoUpgradeOptions", + "BinaryAuthorization", + "CancelOperationRequest", + "ClientCertificateConfig", + "CloudRunConfig", "Cluster", + "ClusterAutoscaling", + "ClusterTelemetry", "ClusterUpdate", - "Operation", - "OperationProgress", + "CompleteIPRotationRequest", + "ConfidentialNodes", + "ConfigConnectorConfig", "CreateClusterRequest", - "GetClusterRequest", - "UpdateClusterRequest", - "UpdateNodePoolRequest", - "SetNodePoolAutoscalingRequest", - "SetLoggingServiceRequest", - "SetMonitoringServiceRequest", - "SetAddonsConfigRequest", - "SetLocationsRequest", - "UpdateMasterRequest", - "SetMasterAuthRequest", + "CreateNodePoolRequest", + "DailyMaintenanceWindow", + "DatabaseEncryption", + "DefaultSnatStatus", "DeleteClusterRequest", + "DeleteNodePoolRequest", + "DnsCacheConfig", + "EphemeralStorageConfig", + "GcePersistentDiskCsiDriverConfig", + "GetClusterRequest", + "GetJSONWebKeysRequest", + "GetJSONWebKeysResponse", + "GetNodePoolRequest", + "GetOpenIDConfigRequest", + "GetOpenIDConfigResponse", + "GetOperationRequest", + "GetServerConfigRequest", + "HorizontalPodAutoscaling", + "HttpLoadBalancing", + "IntraNodeVisibilityConfig", + "IPAllocationPolicy", + "IstioConfig", + "Jwk", + "KalmConfig", + "KubernetesDashboard", + "LegacyAbac", + "LinuxNodeConfig", "ListClustersRequest", "ListClustersResponse", - "GetOperationRequest", + "ListLocationsRequest", + "ListLocationsResponse", + "ListNodePoolsRequest", + "ListNodePoolsResponse", "ListOperationsRequest", - "CancelOperationRequest", "ListOperationsResponse", - "GetServerConfigRequest", - "ServerConfig", - "CreateNodePoolRequest", - "DeleteNodePoolRequest", - "ListNodePoolsRequest", - "GetNodePoolRequest", - "NodePool", - "NodeManagement", - "AutoUpgradeOptions", + "ListUsableSubnetworksRequest", + "ListUsableSubnetworksResponse", + "Location", "MaintenancePolicy", "MaintenanceWindow", - "TimeWindow", + "Master", + "MasterAuth", + "MasterAuthorizedNetworksConfig", + "MaxPodsConstraint", + "NetworkConfig", + "NetworkPolicy", + "NetworkPolicyConfig", + "NodeConfig", + "NodeKubeletConfig", + "NodeManagement", + "NodePool", + "NodePoolAutoscaling", + "NodeTaint", + "NotificationConfig", + "Operation", + "OperationProgress", + "PodSecurityPolicyConfig", + "PrivateClusterConfig", + "PrivateClusterMasterGlobalAccessConfig", "RecurringTimeWindow", - "DailyMaintenanceWindow", - "SetNodePoolManagementRequest", - "SetNodePoolSizeRequest", - "RollbackNodePoolUpgradeRequest", - "ListNodePoolsResponse", - "ClusterAutoscaling", - "AutoprovisioningNodePoolDefaults", + "ReleaseChannel", + "ReservationAffinity", "ResourceLimit", - "NodePoolAutoscaling", + "ResourceUsageExportConfig", + "RollbackNodePoolUpgradeRequest", + "SandboxConfig", + "ServerConfig", + "SetAddonsConfigRequest", "SetLabelsRequest", "SetLegacyAbacRequest", - "StartIPRotationRequest", - "CompleteIPRotationRequest", - "AcceleratorConfig", - "WorkloadMetadataConfig", - "SetNetworkPolicyRequest", + "SetLocationsRequest", + "SetLoggingServiceRequest", "SetMaintenancePolicyRequest", - "ListLocationsRequest", - "ListLocationsResponse", - "Location", + "SetMasterAuthRequest", + "SetMonitoringServiceRequest", + "SetNetworkPolicyRequest", + "SetNodePoolAutoscalingRequest", + "SetNodePoolManagementRequest", + "SetNodePoolSizeRequest", + "ShieldedInstanceConfig", + "ShieldedNodes", + "StartIPRotationRequest", "StatusCondition", - "NetworkConfig", - "ListUsableSubnetworksRequest", - "ListUsableSubnetworksResponse", - "UsableSubnetworkSecondaryRange", + "TimeWindow", + "TpuConfig", + "UpdateClusterRequest", + "UpdateMasterRequest", + "UpdateNodePoolRequest", + "UpgradeEvent", "UsableSubnetwork", + "UsableSubnetworkSecondaryRange", "VerticalPodAutoscaling", - "DefaultSnatStatus", - "IntraNodeVisibilityConfig", - "MaxPodsConstraint", "WorkloadIdentityConfig", - "DatabaseEncryption", - "ResourceUsageExportConfig", - "ShieldedNodes", - "GetOpenIDConfigRequest", - "GetOpenIDConfigResponse", - "GetJSONWebKeysRequest", - "Jwk", - "GetJSONWebKeysResponse", - "ReleaseChannel", - "TpuConfig", - "Master", - "NotificationConfig", - "ConfidentialNodes", - "UpgradeEvent", + "WorkloadMetadataConfig", "DatapathProvider", "UpgradeResourceType", ) diff --git a/google/cloud/container_v1beta1/types/cluster_service.py b/google/cloud/container_v1beta1/types/cluster_service.py index e3185724..4ab224c7 100644 --- a/google/cloud/container_v1beta1/types/cluster_service.py +++ b/google/cloud/container_v1beta1/types/cluster_service.py @@ -167,7 +167,7 @@ class LinuxNodeConfig(proto.Message): r"""Parameters that can be configured on Linux nodes. Attributes: - sysctls (Sequence[~.cluster_service.LinuxNodeConfig.SysctlsEntry]): + sysctls (Sequence[google.cloud.container_v1beta1.types.LinuxNodeConfig.SysctlsEntry]): The Linux kernel parameters to be applied to the nodes and all pods running on the nodes. @@ -199,7 +199,7 @@ class NodeKubeletConfig(proto.Message): increased CPU affinity and exclusivity on the node. The default value is 'none' if unspecified. - cpu_cfs_quota (~.wrappers.BoolValue): + cpu_cfs_quota (google.protobuf.wrappers_pb2.BoolValue): Enable CPU CFS quota enforcement for containers that specify CPU limits. This option is enabled by default which makes @@ -267,7 +267,7 @@ class NodeConfig(proto.Message): address of the Service Account; otherwise, if no Service Account is specified, the "default" service account is used. - metadata (Sequence[~.cluster_service.NodeConfig.MetadataEntry]): + metadata (Sequence[google.cloud.container_v1beta1.types.NodeConfig.MetadataEntry]): The metadata key/value pairs assigned to instances in the cluster. @@ -312,7 +312,7 @@ class NodeConfig(proto.Message): The image type to use for this node. Note that for a given image type, the latest version of it will be used. - labels (Sequence[~.cluster_service.NodeConfig.LabelsEntry]): + labels (Sequence[google.cloud.container_v1beta1.types.NodeConfig.LabelsEntry]): The map of Kubernetes labels (key/value pairs) to be applied to each node. These will added in addition to any default label(s) that @@ -346,19 +346,19 @@ class NodeConfig(proto.Message): https://cloud.google.com/compute/docs/instances/preemptible for more inforamtion about preemptible VM instances. - accelerators (Sequence[~.cluster_service.AcceleratorConfig]): + accelerators (Sequence[google.cloud.container_v1beta1.types.AcceleratorConfig]): A list of hardware accelerators to be attached to each node. See https://cloud.google.com/compute/docs/gpus for more information about support for GPUs. - sandbox_config (~.cluster_service.SandboxConfig): + sandbox_config (google.cloud.container_v1beta1.types.SandboxConfig): Sandbox configuration for this node. node_group (str): Setting this field will assign instances of this pool to run on the specified node group. This is useful for running workloads on `sole tenant nodes `__. - reservation_affinity (~.cluster_service.ReservationAffinity): + reservation_affinity (google.cloud.container_v1beta1.types.ReservationAffinity): The optional reservation affinity. Setting this field will apply the specified `Zonal Compute Reservation `__ @@ -377,10 +377,10 @@ class NodeConfig(proto.Message): ``minCpuPlatform: "Intel Sandy Bridge"``. For more information, read `how to specify min CPU platform `__ - workload_metadata_config (~.cluster_service.WorkloadMetadataConfig): + workload_metadata_config (google.cloud.container_v1beta1.types.WorkloadMetadataConfig): The workload metadata configuration for this node. - taints (Sequence[~.cluster_service.NodeTaint]): + taints (Sequence[google.cloud.container_v1beta1.types.NodeTaint]): List of kubernetes taints to be applied to each node. For more information, including usage and the @@ -395,14 +395,14 @@ class NodeConfig(proto.Message): For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption - shielded_instance_config (~.cluster_service.ShieldedInstanceConfig): + shielded_instance_config (google.cloud.container_v1beta1.types.ShieldedInstanceConfig): Shielded Instance options. - linux_node_config (~.cluster_service.LinuxNodeConfig): + linux_node_config (google.cloud.container_v1beta1.types.LinuxNodeConfig): Parameters that can be configured on Linux nodes. - kubelet_config (~.cluster_service.NodeKubeletConfig): + kubelet_config (google.cloud.container_v1beta1.types.NodeKubeletConfig): Node kubelet configs. - ephemeral_storage_config (~.cluster_service.EphemeralStorageConfig): + ephemeral_storage_config (google.cloud.container_v1beta1.types.EphemeralStorageConfig): Parameters for the ephemeral storage filesystem. If unspecified, ephemeral storage is backed by the boot disk. @@ -503,7 +503,7 @@ class SandboxConfig(proto.Message): sandbox_type (str): Type of the sandbox to use for the node (e.g. 'gvisor') - type_ (~.cluster_service.SandboxConfig.Type): + type_ (google.cloud.container_v1beta1.types.SandboxConfig.Type): Type of the sandbox to use for the node. """ @@ -538,7 +538,7 @@ class ReservationAffinity(proto.Message): take capacity from. Attributes: - consume_reservation_type (~.cluster_service.ReservationAffinity.Type): + consume_reservation_type (google.cloud.container_v1beta1.types.ReservationAffinity.Type): Corresponds to the type of reservation consumption. key (str): @@ -581,7 +581,7 @@ class NodeTaint(proto.Message): Key for taint. value (str): Value for taint. - effect (~.cluster_service.NodeTaint.Effect): + effect (google.cloud.container_v1beta1.types.NodeTaint.Effect): Effect for taint. """ @@ -631,7 +631,7 @@ class MasterAuth(proto.Message): authentication methods, see: https://cloud.google.com/kubernetes- engine/docs/how-to/api-server-authentication - client_certificate_config (~.cluster_service.ClientCertificateConfig): + client_certificate_config (google.cloud.container_v1beta1.types.ClientCertificateConfig): Configuration for client certificate authentication on the cluster. For clusters before v1.12, if no configuration is specified, @@ -677,18 +677,18 @@ class AddonsConfig(proto.Message): up in the cluster, enabling additional functionality. Attributes: - http_load_balancing (~.cluster_service.HttpLoadBalancing): + http_load_balancing (google.cloud.container_v1beta1.types.HttpLoadBalancing): Configuration for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster. - horizontal_pod_autoscaling (~.cluster_service.HorizontalPodAutoscaling): + horizontal_pod_autoscaling (google.cloud.container_v1beta1.types.HorizontalPodAutoscaling): Configuration for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods. - kubernetes_dashboard (~.cluster_service.KubernetesDashboard): + kubernetes_dashboard (google.cloud.container_v1beta1.types.KubernetesDashboard): Configuration for the Kubernetes Dashboard. This addon is deprecated, and will be disabled in 1.15. It is recommended to use the Cloud @@ -697,29 +697,29 @@ class AddonsConfig(proto.Message): information, see: https://cloud.google.com/kubernetes- engine/docs/concepts/dashboards - network_policy_config (~.cluster_service.NetworkPolicyConfig): + network_policy_config (google.cloud.container_v1beta1.types.NetworkPolicyConfig): Configuration for NetworkPolicy. This only tracks whether the addon is enabled or not on the Master, it does not track whether network policy is enabled for the nodes. - istio_config (~.cluster_service.IstioConfig): + istio_config (google.cloud.container_v1beta1.types.IstioConfig): Configuration for Istio, an open platform to connect, manage, and secure microservices. - cloud_run_config (~.cluster_service.CloudRunConfig): + cloud_run_config (google.cloud.container_v1beta1.types.CloudRunConfig): Configuration for the Cloud Run addon. The ``IstioConfig`` addon must be enabled in order to enable Cloud Run addon. This option can only be enabled at cluster creation time. - dns_cache_config (~.cluster_service.DnsCacheConfig): + dns_cache_config (google.cloud.container_v1beta1.types.DnsCacheConfig): Configuration for NodeLocalDNS, a dns cache running on cluster nodes - config_connector_config (~.cluster_service.ConfigConnectorConfig): + config_connector_config (google.cloud.container_v1beta1.types.ConfigConnectorConfig): Configuration for the ConfigConnector add-on, a Kubernetes extension to manage hosted GCP services through the Kubernetes API - gce_persistent_disk_csi_driver_config (~.cluster_service.GcePersistentDiskCsiDriverConfig): + gce_persistent_disk_csi_driver_config (google.cloud.container_v1beta1.types.GcePersistentDiskCsiDriverConfig): Configuration for the Compute Engine Persistent Disk CSI driver. - kalm_config (~.cluster_service.KalmConfig): + kalm_config (google.cloud.container_v1beta1.types.KalmConfig): Configuration for the KALM addon, which manages the lifecycle of k8s applications. """ @@ -904,7 +904,7 @@ class PrivateClusterConfig(proto.Message): peering_name (str): Output only. The peering name in the customer VPC used by this cluster. - master_global_access_config (~.cluster_service.PrivateClusterMasterGlobalAccessConfig): + master_global_access_config (google.cloud.container_v1beta1.types.PrivateClusterMasterGlobalAccessConfig): Controls master global access settings. """ @@ -931,7 +931,7 @@ class IstioConfig(proto.Message): Attributes: disabled (bool): Whether Istio is enabled for this cluster. - auth (~.cluster_service.IstioConfig.IstioAuthMode): + auth (google.cloud.container_v1beta1.types.IstioConfig.IstioAuthMode): The specified Istio auth mode, either none, or mutual TLS. """ @@ -955,7 +955,7 @@ class CloudRunConfig(proto.Message): disabled (bool): Whether Cloud Run addon is enabled for this cluster. - load_balancer_type (~.cluster_service.CloudRunConfig.LoadBalancerType): + load_balancer_type (google.cloud.container_v1beta1.types.CloudRunConfig.LoadBalancerType): Which load balancer type is installed for Cloud Run. """ @@ -982,7 +982,7 @@ class MasterAuthorizedNetworksConfig(proto.Message): enabled (bool): Whether or not master authorized networks is enabled. - cidr_blocks (Sequence[~.cluster_service.MasterAuthorizedNetworksConfig.CidrBlock]): + cidr_blocks (Sequence[google.cloud.container_v1beta1.types.MasterAuthorizedNetworksConfig.CidrBlock]): cidr_blocks define up to 10 external networks that could access Kubernetes master through HTTPS. """ @@ -1030,7 +1030,7 @@ class NetworkPolicy(proto.Message): networking/networkpolicies/ Attributes: - provider (~.cluster_service.NetworkPolicy.Provider): + provider (google.cloud.container_v1beta1.types.NetworkPolicy.Provider): The selected network policy provider. enabled (bool): Whether network policy is enabled on the @@ -1264,7 +1264,7 @@ class ClusterTelemetry(proto.Message): r"""Telemetry integration for the cluster. Attributes: - type_ (~.cluster_service.ClusterTelemetry.Type): + type_ (google.cloud.container_v1beta1.types.ClusterTelemetry.Type): Type of the integration. """ @@ -1305,7 +1305,7 @@ class Cluster(proto.Message): This field is deprecated, use node_pool.initial_node_count instead. - node_config (~.cluster_service.NodeConfig): + node_config (google.cloud.container_v1beta1.types.NodeConfig): Parameters used in creating the cluster's nodes. For requests, this field should only be used in lieu of a "node_pool" object, since this configuration (along with the @@ -1318,7 +1318,7 @@ class Cluster(proto.Message): If unspecified, the defaults are used. This field is deprecated, use node_pool.config instead. - master_auth (~.cluster_service.MasterAuth): + master_auth (google.cloud.container_v1beta1.types.MasterAuth): The authentication information for accessing the master endpoint. If unspecified, the defaults are used: For clusters before v1.12, if master_auth is unspecified, @@ -1366,7 +1366,7 @@ class Cluster(proto.Message): notation (e.g. ``10.96.0.0/14``). Leave blank to have one automatically chosen or specify a ``/14`` block in ``10.0.0.0/8``. - addons_config (~.cluster_service.AddonsConfig): + addons_config (google.cloud.container_v1beta1.types.AddonsConfig): Configurations for the various addons available to run in the cluster. subnetwork (str): @@ -1374,7 +1374,7 @@ class Cluster(proto.Message): `subnetwork `__ to which the cluster is connected. On output this shows the subnetwork ID instead of the name. - node_pools (Sequence[~.cluster_service.NodePool]): + node_pools (Sequence[google.cloud.container_v1beta1.types.NodePool]): The node pools associated with this cluster. This field should not be set if "node_config" or "initial_node_count" are specified. @@ -1400,35 +1400,35 @@ class Cluster(proto.Message): master/node upgrades are disabled. Alpha enabled clusters are automatically deleted thirty days after creation. - resource_labels (Sequence[~.cluster_service.Cluster.ResourceLabelsEntry]): + resource_labels (Sequence[google.cloud.container_v1beta1.types.Cluster.ResourceLabelsEntry]): The resource labels for the cluster to use to annotate any related Google Compute Engine resources. label_fingerprint (str): The fingerprint of the set of labels for this cluster. - legacy_abac (~.cluster_service.LegacyAbac): + legacy_abac (google.cloud.container_v1beta1.types.LegacyAbac): Configuration for the legacy ABAC authorization mode. - network_policy (~.cluster_service.NetworkPolicy): + network_policy (google.cloud.container_v1beta1.types.NetworkPolicy): Configuration options for the NetworkPolicy feature. - ip_allocation_policy (~.cluster_service.IPAllocationPolicy): + ip_allocation_policy (google.cloud.container_v1beta1.types.IPAllocationPolicy): Configuration for cluster IP allocation. - master_authorized_networks_config (~.cluster_service.MasterAuthorizedNetworksConfig): + master_authorized_networks_config (google.cloud.container_v1beta1.types.MasterAuthorizedNetworksConfig): The configuration options for master authorized networks feature. - maintenance_policy (~.cluster_service.MaintenancePolicy): + maintenance_policy (google.cloud.container_v1beta1.types.MaintenancePolicy): Configure the maintenance policy for this cluster. - binary_authorization (~.cluster_service.BinaryAuthorization): + binary_authorization (google.cloud.container_v1beta1.types.BinaryAuthorization): Configuration for Binary Authorization. - pod_security_policy_config (~.cluster_service.PodSecurityPolicyConfig): + pod_security_policy_config (google.cloud.container_v1beta1.types.PodSecurityPolicyConfig): Configuration for the PodSecurityPolicy feature. - autoscaling (~.cluster_service.ClusterAutoscaling): + autoscaling (google.cloud.container_v1beta1.types.ClusterAutoscaling): Cluster-level autoscaling configuration. - network_config (~.cluster_service.NetworkConfig): + network_config (google.cloud.container_v1beta1.types.NetworkConfig): Configuration for cluster networking. private_cluster (bool): If this is a private cluster setup. Private clusters are @@ -1442,37 +1442,37 @@ class Cluster(proto.Message): addresses to the master or set of masters, as well as the ILB VIP. This field is deprecated, use private_cluster_config.master_ipv4_cidr_block instead. - default_max_pods_constraint (~.cluster_service.MaxPodsConstraint): + default_max_pods_constraint (google.cloud.container_v1beta1.types.MaxPodsConstraint): The default constraint on the maximum number of pods that can be run simultaneously on a node in the node pool of this cluster. Only honored if cluster created with IP Alias support. - resource_usage_export_config (~.cluster_service.ResourceUsageExportConfig): + resource_usage_export_config (google.cloud.container_v1beta1.types.ResourceUsageExportConfig): Configuration for exporting resource usages. Resource usage export is disabled when this config unspecified. - authenticator_groups_config (~.cluster_service.AuthenticatorGroupsConfig): + authenticator_groups_config (google.cloud.container_v1beta1.types.AuthenticatorGroupsConfig): Configuration controlling RBAC group membership information. - private_cluster_config (~.cluster_service.PrivateClusterConfig): + private_cluster_config (google.cloud.container_v1beta1.types.PrivateClusterConfig): Configuration for private cluster. - vertical_pod_autoscaling (~.cluster_service.VerticalPodAutoscaling): + vertical_pod_autoscaling (google.cloud.container_v1beta1.types.VerticalPodAutoscaling): Cluster-level Vertical Pod Autoscaling configuration. - shielded_nodes (~.cluster_service.ShieldedNodes): + shielded_nodes (google.cloud.container_v1beta1.types.ShieldedNodes): Shielded Nodes configuration. - release_channel (~.cluster_service.ReleaseChannel): + release_channel (google.cloud.container_v1beta1.types.ReleaseChannel): Release channel configuration. - workload_identity_config (~.cluster_service.WorkloadIdentityConfig): + workload_identity_config (google.cloud.container_v1beta1.types.WorkloadIdentityConfig): Configuration for the use of Kubernetes Service Accounts in GCP IAM policies. - cluster_telemetry (~.cluster_service.ClusterTelemetry): + cluster_telemetry (google.cloud.container_v1beta1.types.ClusterTelemetry): Telemetry integration for the cluster. - tpu_config (~.cluster_service.TpuConfig): + tpu_config (google.cloud.container_v1beta1.types.TpuConfig): Configuration for Cloud TPU support; - notification_config (~.cluster_service.NotificationConfig): + notification_config (google.cloud.container_v1beta1.types.NotificationConfig): Notification configuration of the cluster. - confidential_nodes (~.cluster_service.ConfidentialNodes): + confidential_nodes (google.cloud.container_v1beta1.types.ConfidentialNodes): Configuration of Confidential Nodes self_link (str): [Output only] Server-defined URL for the resource. @@ -1520,7 +1520,7 @@ class Cluster(proto.Message): [Output only] The time the cluster was created, in `RFC3339 `__ text format. - status (~.cluster_service.Cluster.Status): + status (google.cloud.container_v1beta1.types.Cluster.Status): [Output only] The current status of this cluster. status_message (str): [Output only] Deprecated. Use conditions instead. Additional @@ -1562,12 +1562,12 @@ class Cluster(proto.Message): cluster, in `CIDR `__ notation (e.g. ``1.2.3.4/29``). - database_encryption (~.cluster_service.DatabaseEncryption): + database_encryption (google.cloud.container_v1beta1.types.DatabaseEncryption): Configuration of etcd encryption. - conditions (Sequence[~.cluster_service.StatusCondition]): + conditions (Sequence[google.cloud.container_v1beta1.types.StatusCondition]): Which conditions caused the current cluster state. - master (~.cluster_service.Master): + master (google.cloud.container_v1beta1.types.Master): Configuration for master components. """ @@ -1767,7 +1767,7 @@ class ClusterUpdate(proto.Message): string,\ ``monitoring.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``monitoring.googleapis.com`` for earlier versions. - desired_addons_config (~.cluster_service.AddonsConfig): + desired_addons_config (google.cloud.container_v1beta1.types.AddonsConfig): Configurations for the various addons available to run in the cluster. desired_node_pool_id (str): @@ -1779,7 +1779,7 @@ class ClusterUpdate(proto.Message): desired_image_type (str): The desired image type for the node pool. NOTE: Set the "desired_node_pool" field as well. - desired_node_pool_autoscaling (~.cluster_service.NodePoolAutoscaling): + desired_node_pool_autoscaling (google.cloud.container_v1beta1.types.NodePoolAutoscaling): Autoscaler configuration for the node pool specified in desired_node_pool_id. If there is only one pool in the cluster and desired_node_pool_id is not provided then the @@ -1794,15 +1794,15 @@ class ClusterUpdate(proto.Message): Warning: changing cluster locations will update the locations of all node pools and will result in nodes being added and/or removed. - desired_master_authorized_networks_config (~.cluster_service.MasterAuthorizedNetworksConfig): + desired_master_authorized_networks_config (google.cloud.container_v1beta1.types.MasterAuthorizedNetworksConfig): The desired configuration options for master authorized networks feature. - desired_pod_security_policy_config (~.cluster_service.PodSecurityPolicyConfig): + desired_pod_security_policy_config (google.cloud.container_v1beta1.types.PodSecurityPolicyConfig): The desired configuration options for the PodSecurityPolicy feature. - desired_cluster_autoscaling (~.cluster_service.ClusterAutoscaling): + desired_cluster_autoscaling (google.cloud.container_v1beta1.types.ClusterAutoscaling): Cluster-level autoscaling configuration. - desired_binary_authorization (~.cluster_service.BinaryAuthorization): + desired_binary_authorization (google.cloud.container_v1beta1.types.BinaryAuthorization): The desired configuration options for the Binary Authorization feature. desired_logging_service (str): @@ -1819,30 +1819,30 @@ class ClusterUpdate(proto.Message): string,\ ``logging.googleapis.com/kubernetes`` will be used for GKE 1.14+ or ``logging.googleapis.com`` for earlier versions. - desired_resource_usage_export_config (~.cluster_service.ResourceUsageExportConfig): + desired_resource_usage_export_config (google.cloud.container_v1beta1.types.ResourceUsageExportConfig): The desired configuration for exporting resource usage. - desired_vertical_pod_autoscaling (~.cluster_service.VerticalPodAutoscaling): + desired_vertical_pod_autoscaling (google.cloud.container_v1beta1.types.VerticalPodAutoscaling): Cluster-level Vertical Pod Autoscaling configuration. - desired_private_cluster_config (~.cluster_service.PrivateClusterConfig): + desired_private_cluster_config (google.cloud.container_v1beta1.types.PrivateClusterConfig): The desired private cluster configuration. - desired_intra_node_visibility_config (~.cluster_service.IntraNodeVisibilityConfig): + desired_intra_node_visibility_config (google.cloud.container_v1beta1.types.IntraNodeVisibilityConfig): The desired config of Intra-node visibility. - desired_default_snat_status (~.cluster_service.DefaultSnatStatus): + desired_default_snat_status (google.cloud.container_v1beta1.types.DefaultSnatStatus): The desired status of whether to disable default sNAT for this cluster. - desired_cluster_telemetry (~.cluster_service.ClusterTelemetry): + desired_cluster_telemetry (google.cloud.container_v1beta1.types.ClusterTelemetry): The desired telemetry integration for the cluster. - desired_release_channel (~.cluster_service.ReleaseChannel): + desired_release_channel (google.cloud.container_v1beta1.types.ReleaseChannel): The desired release channel configuration. - desired_tpu_config (~.cluster_service.TpuConfig): + desired_tpu_config (google.cloud.container_v1beta1.types.TpuConfig): The desired Cloud TPU configuration. - desired_datapath_provider (~.cluster_service.DatapathProvider): + desired_datapath_provider (google.cloud.container_v1beta1.types.DatapathProvider): The desired datapath provider for the cluster. - desired_notification_config (~.cluster_service.NotificationConfig): + desired_notification_config (google.cloud.container_v1beta1.types.NotificationConfig): The desired notification configuration. desired_master_version (str): The Kubernetes version to change the master @@ -1858,13 +1858,13 @@ class ClusterUpdate(proto.Message): version - "1.X.Y-gke.N": picks an explicit Kubernetes version - "-": picks the default Kubernetes version - desired_database_encryption (~.cluster_service.DatabaseEncryption): + desired_database_encryption (google.cloud.container_v1beta1.types.DatabaseEncryption): Configuration of etcd encryption. - desired_workload_identity_config (~.cluster_service.WorkloadIdentityConfig): + desired_workload_identity_config (google.cloud.container_v1beta1.types.WorkloadIdentityConfig): Configuration for Workload Identity. - desired_shielded_nodes (~.cluster_service.ShieldedNodes): + desired_shielded_nodes (google.cloud.container_v1beta1.types.ShieldedNodes): Configuration for Shielded Nodes. - desired_master (~.cluster_service.Master): + desired_master (google.cloud.container_v1beta1.types.Master): Configuration for master components. """ @@ -1972,9 +1972,9 @@ class Operation(proto.Message): `zone `__ in which the operation is taking place. This field is deprecated, use location instead. - operation_type (~.cluster_service.Operation.Type): + operation_type (google.cloud.container_v1beta1.types.Operation.Type): The operation type. - status (~.cluster_service.Operation.Status): + status (google.cloud.container_v1beta1.types.Operation.Status): The current status of the operation. detail (str): Detailed operation progress, if available. @@ -2001,16 +2001,16 @@ class Operation(proto.Message): [Output only] The time the operation completed, in `RFC3339 `__ text format. - progress (~.cluster_service.OperationProgress): + progress (google.cloud.container_v1beta1.types.OperationProgress): Output only. [Output only] Progress information for an operation. - cluster_conditions (Sequence[~.cluster_service.StatusCondition]): + cluster_conditions (Sequence[google.cloud.container_v1beta1.types.StatusCondition]): Which conditions caused the current cluster state. Deprecated. Use field error instead. - nodepool_conditions (Sequence[~.cluster_service.StatusCondition]): + nodepool_conditions (Sequence[google.cloud.container_v1beta1.types.StatusCondition]): Which conditions caused the current node pool state. Deprecated. Use field error instead. - error (~.gr_status.Status): + error (google.rpc.status_pb2.Status): The error result of the operation in case of failure. """ @@ -2086,15 +2086,15 @@ class OperationProgress(proto.Message): A non-parameterized string describing an operation stage. Unset for single-stage operations. - status (~.cluster_service.Operation.Status): + status (google.cloud.container_v1beta1.types.Operation.Status): Status of an operation stage. Unset for single-stage operations. - metrics (Sequence[~.cluster_service.OperationProgress.Metric]): + metrics (Sequence[google.cloud.container_v1beta1.types.OperationProgress.Metric]): Progress metric bundle, for example: metrics: [{name: "nodes done", int_value: 15}, {name: "nodes total", int_value: 32}] or metrics: [{name: "progress", double_value: 0.56}, {name: "progress scale", double_value: 1.0}] - stages (Sequence[~.cluster_service.OperationProgress]): + stages (Sequence[google.cloud.container_v1beta1.types.OperationProgress]): Substages of an operation or a stage. """ @@ -2146,7 +2146,7 @@ class CreateClusterRequest(proto.Message): `zone `__ in which the cluster resides. This field has been deprecated and replaced by the parent field. - cluster (~.cluster_service.Cluster): + cluster (google.cloud.container_v1beta1.types.Cluster): Required. A `cluster resource `__ parent (str): @@ -2216,7 +2216,7 @@ class UpdateClusterRequest(proto.Message): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - update (~.cluster_service.ClusterUpdate): + update (google.cloud.container_v1beta1.types.ClusterUpdate): Required. A description of the update. name (str): The name (project, location, cluster) of the cluster to @@ -2282,20 +2282,20 @@ class UpdateNodePoolRequest(proto.Message): the locations for a node pool will result in nodes being either created or removed from the node pool, depending on whether locations are being added or removed. - workload_metadata_config (~.cluster_service.WorkloadMetadataConfig): + workload_metadata_config (google.cloud.container_v1beta1.types.WorkloadMetadataConfig): The desired workload metadata config for the node pool. name (str): The name (project, location, cluster, node pool) of the node pool to update. Specified in the format ``projects/*/locations/*/clusters/*/nodePools/*``. - upgrade_settings (~.cluster_service.NodePool.UpgradeSettings): + upgrade_settings (google.cloud.container_v1beta1.types.NodePool.UpgradeSettings): Upgrade settings control disruption and speed of the upgrade. - linux_node_config (~.cluster_service.LinuxNodeConfig): + linux_node_config (google.cloud.container_v1beta1.types.LinuxNodeConfig): Parameters that can be configured on Linux nodes. - kubelet_config (~.cluster_service.NodeKubeletConfig): + kubelet_config (google.cloud.container_v1beta1.types.NodeKubeletConfig): Node kubelet configs. """ @@ -2354,7 +2354,7 @@ class SetNodePoolAutoscalingRequest(proto.Message): Required. Deprecated. The name of the node pool to upgrade. This field has been deprecated and replaced by the name field. - autoscaling (~.cluster_service.NodePoolAutoscaling): + autoscaling (google.cloud.container_v1beta1.types.NodePoolAutoscaling): Required. Autoscaling configuration for the node pool. name (str): @@ -2498,7 +2498,7 @@ class SetAddonsConfigRequest(proto.Message): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - addons_config (~.cluster_service.AddonsConfig): + addons_config (google.cloud.container_v1beta1.types.AddonsConfig): Required. The desired configurations for the various addons available to run in the cluster. name (str): @@ -2631,10 +2631,10 @@ class SetMasterAuthRequest(proto.Message): Required. Deprecated. The name of the cluster to upgrade. This field has been deprecated and replaced by the name field. - action (~.cluster_service.SetMasterAuthRequest.Action): + action (google.cloud.container_v1beta1.types.SetMasterAuthRequest.Action): Required. The exact form of action to be taken on the master auth. - update (~.cluster_service.MasterAuth): + update (google.cloud.container_v1beta1.types.MasterAuth): Required. A description of the update. name (str): The name (project, location, cluster) of the cluster to set @@ -2728,7 +2728,7 @@ class ListClustersResponse(proto.Message): r"""ListClustersResponse is the result of ListClustersRequest. Attributes: - clusters (Sequence[~.cluster_service.Cluster]): + clusters (Sequence[google.cloud.container_v1beta1.types.Cluster]): A list of clusters in the project in the specified zone, or across all ones. missing_zones (Sequence[str]): @@ -2843,7 +2843,7 @@ class ListOperationsResponse(proto.Message): ListOperationsRequest. Attributes: - operations (Sequence[~.cluster_service.Operation]): + operations (Sequence[google.cloud.container_v1beta1.types.Operation]): A list of operations in the project in the specified zone. missing_zones (Sequence[str]): @@ -2901,7 +2901,7 @@ class ServerConfig(proto.Message): valid_master_versions (Sequence[str]): List of valid master versions, in descending order. - channels (Sequence[~.cluster_service.ServerConfig.ReleaseChannelConfig]): + channels (Sequence[google.cloud.container_v1beta1.types.ServerConfig.ReleaseChannelConfig]): List of release channel configurations. """ @@ -2910,13 +2910,13 @@ class ReleaseChannelConfig(proto.Message): channel. Attributes: - channel (~.cluster_service.ReleaseChannel.Channel): + channel (google.cloud.container_v1beta1.types.ReleaseChannel.Channel): The release channel this configuration applies to. default_version (str): The default version for newly created clusters on the channel. - available_versions (Sequence[~.cluster_service.ServerConfig.ReleaseChannelConfig.AvailableVersion]): + available_versions (Sequence[google.cloud.container_v1beta1.types.ServerConfig.ReleaseChannelConfig.AvailableVersion]): Deprecated. This field has been deprecated and replaced with the valid_versions field. valid_versions (Sequence[str]): @@ -2983,7 +2983,7 @@ class CreateNodePoolRequest(proto.Message): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the parent field. - node_pool (~.cluster_service.NodePool): + node_pool (google.cloud.container_v1beta1.types.NodePool): Required. The node pool to create. parent (str): The parent (project, location, cluster id) where the node @@ -3128,7 +3128,7 @@ class NodePool(proto.Message): Attributes: name (str): The name of the node pool. - config (~.cluster_service.NodeConfig): + config (google.cloud.container_v1beta1.types.NodeConfig): The node configuration of the pool. initial_node_count (int): The initial node count for the pool. You must ensure that @@ -3155,30 +3155,30 @@ class NodePool(proto.Message): [Output only] The resource URLs of the `managed instance groups `__ associated with this node pool. - status (~.cluster_service.NodePool.Status): + status (google.cloud.container_v1beta1.types.NodePool.Status): [Output only] The status of the nodes in this pool instance. status_message (str): [Output only] Deprecated. Use conditions instead. Additional information about the current status of this node pool instance, if available. - autoscaling (~.cluster_service.NodePoolAutoscaling): + autoscaling (google.cloud.container_v1beta1.types.NodePoolAutoscaling): Autoscaler configuration for this NodePool. Autoscaler is enabled only if a valid configuration is present. - management (~.cluster_service.NodeManagement): + management (google.cloud.container_v1beta1.types.NodeManagement): NodeManagement configuration for this NodePool. - max_pods_constraint (~.cluster_service.MaxPodsConstraint): + max_pods_constraint (google.cloud.container_v1beta1.types.MaxPodsConstraint): The constraint on the maximum number of pods that can be run simultaneously on a node in the node pool. - conditions (Sequence[~.cluster_service.StatusCondition]): + conditions (Sequence[google.cloud.container_v1beta1.types.StatusCondition]): Which conditions caused the current node pool state. pod_ipv4_cidr_size (int): [Output only] The pod CIDR block size per node in this node pool. - upgrade_settings (~.cluster_service.NodePool.UpgradeSettings): + upgrade_settings (google.cloud.container_v1beta1.types.NodePool.UpgradeSettings): Upgrade settings control disruption and speed of the upgrade. """ @@ -3281,7 +3281,7 @@ class NodeManagement(proto.Message): auto_repair (bool): Whether the nodes will be automatically repaired. - upgrade_options (~.cluster_service.AutoUpgradeOptions): + upgrade_options (google.cloud.container_v1beta1.types.AutoUpgradeOptions): Specifies the Auto Upgrade knobs for the node pool. """ @@ -3320,7 +3320,7 @@ class MaintenancePolicy(proto.Message): for the cluster. Attributes: - window (~.cluster_service.MaintenanceWindow): + window (google.cloud.container_v1beta1.types.MaintenanceWindow): Specifies the maintenance window in which maintenance may be performed. resource_version (str): @@ -3343,16 +3343,16 @@ class MaintenanceWindow(proto.Message): for the cluster. Attributes: - daily_maintenance_window (~.cluster_service.DailyMaintenanceWindow): + daily_maintenance_window (google.cloud.container_v1beta1.types.DailyMaintenanceWindow): DailyMaintenanceWindow specifies a daily maintenance operation window. - recurring_window (~.cluster_service.RecurringTimeWindow): + recurring_window (google.cloud.container_v1beta1.types.RecurringTimeWindow): RecurringWindow specifies some number of recurring time periods for maintenance to occur. The time windows may be overlapping. If no maintenance windows are set, maintenance can occur at any time. - maintenance_exclusions (Sequence[~.cluster_service.MaintenanceWindow.MaintenanceExclusionsEntry]): + maintenance_exclusions (Sequence[google.cloud.container_v1beta1.types.MaintenanceWindow.MaintenanceExclusionsEntry]): Exceptions to maintenance window. Non- mergency maintenance should not occur in these windows. @@ -3375,9 +3375,9 @@ class TimeWindow(proto.Message): r"""Represents an arbitrary window of time. Attributes: - start_time (~.timestamp.Timestamp): + start_time (google.protobuf.timestamp_pb2.Timestamp): The time that the window first starts. - end_time (~.timestamp.Timestamp): + end_time (google.protobuf.timestamp_pb2.Timestamp): The time that the window ends. The end time should take place after the start time. """ @@ -3391,7 +3391,7 @@ class RecurringTimeWindow(proto.Message): r"""Represents an arbitrary window of time that recurs. Attributes: - window (~.cluster_service.TimeWindow): + window (google.cloud.container_v1beta1.types.TimeWindow): The window of the first recurrence. recurrence (str): An RRULE @@ -3481,7 +3481,7 @@ class SetNodePoolManagementRequest(proto.Message): Required. Deprecated. The name of the node pool to update. This field has been deprecated and replaced by the name field. - management (~.cluster_service.NodeManagement): + management (google.cloud.container_v1beta1.types.NodeManagement): Required. NodeManagement configuration for the node pool. name (str): @@ -3595,7 +3595,7 @@ class ListNodePoolsResponse(proto.Message): r"""ListNodePoolsResponse is the result of ListNodePoolsRequest. Attributes: - node_pools (Sequence[~.cluster_service.NodePool]): + node_pools (Sequence[google.cloud.container_v1beta1.types.NodePool]): A list of node pools for a cluster. """ @@ -3612,12 +3612,12 @@ class ClusterAutoscaling(proto.Message): enable_node_autoprovisioning (bool): Enables automatic node pool creation and deletion. - resource_limits (Sequence[~.cluster_service.ResourceLimit]): + resource_limits (Sequence[google.cloud.container_v1beta1.types.ResourceLimit]): Contains global constraints regarding minimum and maximum amount of resources in the cluster. - autoscaling_profile (~.cluster_service.ClusterAutoscaling.AutoscalingProfile): + autoscaling_profile (google.cloud.container_v1beta1.types.ClusterAutoscaling.AutoscalingProfile): Defines autoscaling behaviour. - autoprovisioning_node_pool_defaults (~.cluster_service.AutoprovisioningNodePoolDefaults): + autoprovisioning_node_pool_defaults (google.cloud.container_v1beta1.types.AutoprovisioningNodePoolDefaults): AutoprovisioningNodePoolDefaults contains defaults for a node pool created by NAP. autoprovisioning_locations (Sequence[str]): @@ -3675,10 +3675,10 @@ class AutoprovisioningNodePoolDefaults(proto.Message): address of the Service Account; otherwise, if no Service Account is specified, the "default" service account is used. - upgrade_settings (~.cluster_service.NodePool.UpgradeSettings): + upgrade_settings (google.cloud.container_v1beta1.types.NodePool.UpgradeSettings): Upgrade settings control disruption and speed of the upgrade. - management (~.cluster_service.NodeManagement): + management (google.cloud.container_v1beta1.types.NodeManagement): NodeManagement configuration for this NodePool. min_cpu_platform (str): @@ -3702,7 +3702,7 @@ class AutoprovisioningNodePoolDefaults(proto.Message): If unspecified, the default disk type is 'pd- standard' - shielded_instance_config (~.cluster_service.ShieldedInstanceConfig): + shielded_instance_config (google.cloud.container_v1beta1.types.ShieldedInstanceConfig): Shielded Instance options. boot_disk_kms_key (str): The Customer Managed Encryption Key used to encrypt the boot @@ -3809,7 +3809,7 @@ class SetLabelsRequest(proto.Message): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - resource_labels (Sequence[~.cluster_service.SetLabelsRequest.ResourceLabelsEntry]): + resource_labels (Sequence[google.cloud.container_v1beta1.types.SetLabelsRequest.ResourceLabelsEntry]): Required. The labels to set for that cluster. label_fingerprint (str): Required. The fingerprint of the previous set of labels for @@ -3977,11 +3977,11 @@ class WorkloadMetadataConfig(proto.Message): expose to workloads on the node pool. Attributes: - node_metadata (~.cluster_service.WorkloadMetadataConfig.NodeMetadata): + node_metadata (google.cloud.container_v1beta1.types.WorkloadMetadataConfig.NodeMetadata): NodeMetadata is the configuration for how to expose metadata to the workloads running on the node. - mode (~.cluster_service.WorkloadMetadataConfig.Mode): + mode (google.cloud.container_v1beta1.types.WorkloadMetadataConfig.Mode): Mode is the configuration for how to expose metadata to workloads running on the node pool. """ @@ -4028,7 +4028,7 @@ class SetNetworkPolicyRequest(proto.Message): Required. Deprecated. The name of the cluster. This field has been deprecated and replaced by the name field. - network_policy (~.cluster_service.NetworkPolicy): + network_policy (google.cloud.container_v1beta1.types.NetworkPolicy): Required. Configuration options for the NetworkPolicy feature. name (str): @@ -4063,7 +4063,7 @@ class SetMaintenancePolicyRequest(proto.Message): in which the cluster resides. cluster_id (str): Required. The name of the cluster to update. - maintenance_policy (~.cluster_service.MaintenancePolicy): + maintenance_policy (google.cloud.container_v1beta1.types.MaintenancePolicy): Required. The maintenance policy to be set for the cluster. An empty field clears the existing maintenance policy. @@ -4104,7 +4104,7 @@ class ListLocationsResponse(proto.Message): and their recommendation state. Attributes: - locations (Sequence[~.cluster_service.Location]): + locations (Sequence[google.cloud.container_v1beta1.types.Location]): A full list of GKE locations. next_page_token (str): Only return ListLocationsResponse that occur after the @@ -4128,7 +4128,7 @@ class Location(proto.Message): recommended for GKE cluster scheduling. Attributes: - type_ (~.cluster_service.Location.LocationType): + type_ (google.cloud.container_v1beta1.types.Location.LocationType): Contains the type of location this Location is for. Regional or Zonal. name (str): @@ -4157,13 +4157,13 @@ class StatusCondition(proto.Message): certain status (e.g., ERROR or DEGRADED). Attributes: - code (~.cluster_service.StatusCondition.Code): + code (google.cloud.container_v1beta1.types.StatusCondition.Code): Machine-friendly representation of the condition Deprecated. Use canonical_code instead. message (str): Human-friendly representation of the condition - canonical_code (~.gr_code.Code): + canonical_code (google.rpc.code_pb2.Code): Canonical code of the condition. """ @@ -4202,13 +4202,13 @@ class NetworkConfig(proto.Message): Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network. - default_snat_status (~.cluster_service.DefaultSnatStatus): + default_snat_status (google.cloud.container_v1beta1.types.DefaultSnatStatus): Whether the cluster disables default in-node sNAT rules. In-node sNAT rules will be disabled when default_snat_status is disabled. When disabled is set to false, default IP masquerade rules will be applied to the nodes to prevent sNAT on cluster internal traffic. - datapath_provider (~.cluster_service.DatapathProvider): + datapath_provider (google.cloud.container_v1beta1.types.DatapathProvider): The desired datapath provider for this cluster. By default, uses the IPTables-based kube-proxy implementation. @@ -4268,7 +4268,7 @@ class ListUsableSubnetworksResponse(proto.Message): ListUsableSubnetworksRequest. Attributes: - subnetworks (Sequence[~.cluster_service.UsableSubnetwork]): + subnetworks (Sequence[google.cloud.container_v1beta1.types.UsableSubnetwork]): A list of usable subnetworks in the specified network project. next_page_token (str): @@ -4301,7 +4301,7 @@ class UsableSubnetworkSecondaryRange(proto.Message): ip_cidr_range (str): The range of IP addresses belonging to this subnetwork secondary range. - status (~.cluster_service.UsableSubnetworkSecondaryRange.Status): + status (google.cloud.container_v1beta1.types.UsableSubnetworkSecondaryRange.Status): This field is to determine the status of the secondary range programmably. """ @@ -4337,7 +4337,7 @@ class UsableSubnetwork(proto.Message): ip_cidr_range (str): The range of internal addresses that are owned by this subnetwork. - secondary_ip_ranges (Sequence[~.cluster_service.UsableSubnetworkSecondaryRange]): + secondary_ip_ranges (Sequence[google.cloud.container_v1beta1.types.UsableSubnetworkSecondaryRange]): Secondary IP ranges. status_message (str): A human readable status message representing the reasons for @@ -4437,7 +4437,7 @@ class DatabaseEncryption(proto.Message): r"""Configuration of etcd encryption. Attributes: - state (~.cluster_service.DatabaseEncryption.State): + state (google.cloud.container_v1beta1.types.DatabaseEncryption.State): Denotes the state of etcd encryption. key_name (str): Name of CloudKMS key to use for the @@ -4461,7 +4461,7 @@ class ResourceUsageExportConfig(proto.Message): r"""Configuration for exporting cluster resource usages. Attributes: - bigquery_destination (~.cluster_service.ResourceUsageExportConfig.BigQueryDestination): + bigquery_destination (google.cloud.container_v1beta1.types.ResourceUsageExportConfig.BigQueryDestination): Configuration to use BigQuery as usage export destination. enable_network_egress_metering (bool): @@ -4469,7 +4469,7 @@ class ResourceUsageExportConfig(proto.Message): this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. - consumption_metering_config (~.cluster_service.ResourceUsageExportConfig.ConsumptionMeteringConfig): + consumption_metering_config (google.cloud.container_v1beta1.types.ResourceUsageExportConfig.ConsumptionMeteringConfig): Configuration to enable resource consumption metering. """ @@ -4637,7 +4637,7 @@ class GetJSONWebKeysResponse(proto.Message): specififed in rfc 7517 Attributes: - keys (Sequence[~.cluster_service.Jwk]): + keys (Sequence[google.cloud.container_v1beta1.types.Jwk]): The public component of the keys used by the cluster to sign token requests. """ @@ -4653,7 +4653,7 @@ class ReleaseChannel(proto.Message): auto-upgrade defaults to true and cannot be disabled. Attributes: - channel (~.cluster_service.ReleaseChannel.Channel): + channel (google.cloud.container_v1beta1.types.ReleaseChannel.Channel): channel specifies which release channel the cluster is subscribed to. """ @@ -4698,7 +4698,7 @@ class NotificationConfig(proto.Message): r"""NotificationConfig is the configuration of notifications. Attributes: - pubsub (~.cluster_service.NotificationConfig.PubSub): + pubsub (google.cloud.container_v1beta1.types.NotificationConfig.PubSub): Notification config for Pub/Sub. """ @@ -4739,13 +4739,13 @@ class UpgradeEvent(proto.Message): cluster server when a resource is upgrading. Attributes: - resource_type (~.cluster_service.UpgradeResourceType): + resource_type (google.cloud.container_v1beta1.types.UpgradeResourceType): Required. The resource type that is upgrading. operation (str): Required. The operation associated with this upgrade. - operation_start_time (~.timestamp.Timestamp): + operation_start_time (google.protobuf.timestamp_pb2.Timestamp): Required. The time when the operation was started. current_version (str): diff --git a/synth.metadata b/synth.metadata index ca7fbc64..8b5c788a 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-container.git", - "sha": "a992fcfff9728d35e849b9b50d35ae8861120dd7" + "sha": "206e49548ee102b59716d58c55373c6aa5b1e990" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907", - "internalRef": "347055288" + "sha": "149a3a84c29c9b8189576c7442ccb6dcf6a8f95b", + "internalRef": "364411656" } }, { @@ -102,8 +102,10 @@ "docs/_static/custom.css", "docs/_templates/layout.html", "docs/conf.py", + "docs/container_v1/cluster_manager.rst", "docs/container_v1/services.rst", "docs/container_v1/types.rst", + "docs/container_v1beta1/cluster_manager.rst", "docs/container_v1beta1/services.rst", "docs/container_v1beta1/types.rst", "docs/multiprocessing.rst", diff --git a/tests/unit/gapic/container_v1/__init__.py b/tests/unit/gapic/container_v1/__init__.py index 8b137891..42ffdf2b 100644 --- a/tests/unit/gapic/container_v1/__init__.py +++ b/tests/unit/gapic/container_v1/__init__.py @@ -1 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/tests/unit/gapic/container_v1/test_cluster_manager.py b/tests/unit/gapic/container_v1/test_cluster_manager.py index 2df46f62..c39da460 100644 --- a/tests/unit/gapic/container_v1/test_cluster_manager.py +++ b/tests/unit/gapic/container_v1/test_cluster_manager.py @@ -86,7 +86,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [ClusterManagerClient, ClusterManagerAsyncClient] + "client_class", [ClusterManagerClient, ClusterManagerAsyncClient,] +) +def test_cluster_manager_client_from_service_account_info(client_class): + creds = credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == "container.googleapis.com:443" + + +@pytest.mark.parametrize( + "client_class", [ClusterManagerClient, ClusterManagerAsyncClient,] ) def test_cluster_manager_client_from_service_account_file(client_class): creds = credentials.AnonymousCredentials() @@ -96,16 +113,21 @@ def test_cluster_manager_client_from_service_account_file(client_class): factory.return_value = creds client = client_class.from_service_account_file("dummy/file/path.json") assert client.transport._credentials == creds + assert isinstance(client, client_class) client = client_class.from_service_account_json("dummy/file/path.json") assert client.transport._credentials == creds + assert isinstance(client, client_class) assert client.transport._host == "container.googleapis.com:443" def test_cluster_manager_client_get_transport_class(): transport = ClusterManagerClient.get_transport_class() - assert transport == transports.ClusterManagerGrpcTransport + available_transports = [ + transports.ClusterManagerGrpcTransport, + ] + assert transport in available_transports transport = ClusterManagerClient.get_transport_class("grpc") assert transport == transports.ClusterManagerGrpcTransport @@ -156,7 +178,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host="squid.clam.whelk", scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -172,7 +194,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host=client.DEFAULT_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -188,7 +210,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host=client.DEFAULT_MTLS_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -216,7 +238,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host=client.DEFAULT_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -267,29 +289,25 @@ def test_cluster_manager_client_mtls_env_auto( client_cert_source=client_cert_source_callback ) with mock.patch.object(transport_class, "__init__") as patched: - ssl_channel_creds = mock.Mock() - with mock.patch( - "grpc.ssl_channel_credentials", return_value=ssl_channel_creds - ): - patched.return_value = None - client = client_class(client_options=options) + patched.return_value = None + client = client_class(client_options=options) - if use_client_cert_env == "false": - expected_ssl_channel_creds = None - expected_host = client.DEFAULT_ENDPOINT - else: - expected_ssl_channel_creds = ssl_channel_creds - expected_host = client.DEFAULT_MTLS_ENDPOINT + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client.DEFAULT_ENDPOINT + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=expected_host, - scopes=None, - ssl_channel_credentials=expected_ssl_channel_creds, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - ) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + ) # Check the case ADC client cert is provided. Whether client cert is used depends on # GOOGLE_API_USE_CLIENT_CERTIFICATE value. @@ -298,66 +316,53 @@ def test_cluster_manager_client_mtls_env_auto( ): with mock.patch.object(transport_class, "__init__") as patched: with mock.patch( - "google.auth.transport.grpc.SslCredentials.__init__", return_value=None + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, ): with mock.patch( - "google.auth.transport.grpc.SslCredentials.is_mtls", - new_callable=mock.PropertyMock, - ) as is_mtls_mock: - with mock.patch( - "google.auth.transport.grpc.SslCredentials.ssl_credentials", - new_callable=mock.PropertyMock, - ) as ssl_credentials_mock: - if use_client_cert_env == "false": - is_mtls_mock.return_value = False - ssl_credentials_mock.return_value = None - expected_host = client.DEFAULT_ENDPOINT - expected_ssl_channel_creds = None - else: - is_mtls_mock.return_value = True - ssl_credentials_mock.return_value = mock.Mock() - expected_host = client.DEFAULT_MTLS_ENDPOINT - expected_ssl_channel_creds = ( - ssl_credentials_mock.return_value - ) - - patched.return_value = None - client = client_class() - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=expected_host, - scopes=None, - ssl_channel_credentials=expected_ssl_channel_creds, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - ) + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client.DEFAULT_ENDPOINT + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback - # Check the case client_cert_source and ADC client cert are not provided. - with mock.patch.dict( - os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} - ): - with mock.patch.object(transport_class, "__init__") as patched: - with mock.patch( - "google.auth.transport.grpc.SslCredentials.__init__", return_value=None - ): - with mock.patch( - "google.auth.transport.grpc.SslCredentials.is_mtls", - new_callable=mock.PropertyMock, - ) as is_mtls_mock: - is_mtls_mock.return_value = False patched.return_value = None client = client_class() patched.assert_called_once_with( credentials=None, credentials_file=None, - host=client.DEFAULT_ENDPOINT, + host=expected_host, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=expected_client_cert_source, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class() + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + ) + @pytest.mark.parametrize( "client_class,transport_class,transport_name", @@ -383,7 +388,7 @@ def test_cluster_manager_client_client_options_scopes( credentials_file=None, host=client.DEFAULT_ENDPOINT, scopes=["1", "2"], - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -413,7 +418,7 @@ def test_cluster_manager_client_client_options_credentials_file( credentials_file="credentials.json", host=client.DEFAULT_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -432,7 +437,7 @@ def test_cluster_manager_client_client_options_from_dict(): credentials_file=None, host="squid.clam.whelk", scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -475,6 +480,22 @@ def test_list_clusters_from_dict(): test_list_clusters(request_type=dict) +def test_list_clusters_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_clusters), "__call__") as call: + client.list_clusters() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListClustersRequest() + + @pytest.mark.asyncio async def test_list_clusters_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListClustersRequest @@ -767,6 +788,22 @@ def test_get_cluster_from_dict(): test_get_cluster(request_type=dict) +def test_get_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_cluster), "__call__") as call: + client.get_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetClusterRequest() + + @pytest.mark.asyncio async def test_get_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetClusterRequest @@ -1103,6 +1140,22 @@ def test_create_cluster_from_dict(): test_create_cluster(request_type=dict) +def test_create_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.create_cluster), "__call__") as call: + client.create_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CreateClusterRequest() + + @pytest.mark.asyncio async def test_create_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.CreateClusterRequest @@ -1388,6 +1441,22 @@ def test_update_cluster_from_dict(): test_update_cluster(request_type=dict) +def test_update_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.update_cluster), "__call__") as call: + client.update_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.UpdateClusterRequest() + + @pytest.mark.asyncio async def test_update_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.UpdateClusterRequest @@ -1693,6 +1762,22 @@ def test_update_node_pool_from_dict(): test_update_node_pool(request_type=dict) +def test_update_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.update_node_pool), "__call__") as call: + client.update_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.UpdateNodePoolRequest() + + @pytest.mark.asyncio async def test_update_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.UpdateNodePoolRequest @@ -1883,6 +1968,24 @@ def test_set_node_pool_autoscaling_from_dict(): test_set_node_pool_autoscaling(request_type=dict) +def test_set_node_pool_autoscaling_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_node_pool_autoscaling), "__call__" + ) as call: + client.set_node_pool_autoscaling() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNodePoolAutoscalingRequest() + + @pytest.mark.asyncio async def test_set_node_pool_autoscaling_async( transport: str = "grpc_asyncio", @@ -2080,6 +2183,24 @@ def test_set_logging_service_from_dict(): test_set_logging_service(request_type=dict) +def test_set_logging_service_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_logging_service), "__call__" + ) as call: + client.set_logging_service() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLoggingServiceRequest() + + @pytest.mark.asyncio async def test_set_logging_service_async( transport: str = "grpc_asyncio", @@ -2386,6 +2507,24 @@ def test_set_monitoring_service_from_dict(): test_set_monitoring_service(request_type=dict) +def test_set_monitoring_service_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_monitoring_service), "__call__" + ) as call: + client.set_monitoring_service() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetMonitoringServiceRequest() + + @pytest.mark.asyncio async def test_set_monitoring_service_async( transport: str = "grpc_asyncio", @@ -2692,6 +2831,24 @@ def test_set_addons_config_from_dict(): test_set_addons_config(request_type=dict) +def test_set_addons_config_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_addons_config), "__call__" + ) as call: + client.set_addons_config() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetAddonsConfigRequest() + + @pytest.mark.asyncio async def test_set_addons_config_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetAddonsConfigRequest @@ -3007,6 +3164,22 @@ def test_set_locations_from_dict(): test_set_locations(request_type=dict) +def test_set_locations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_locations), "__call__") as call: + client.set_locations() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLocationsRequest() + + @pytest.mark.asyncio async def test_set_locations_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetLocationsRequest @@ -3300,6 +3473,22 @@ def test_update_master_from_dict(): test_update_master(request_type=dict) +def test_update_master_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.update_master), "__call__") as call: + client.update_master() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.UpdateMasterRequest() + + @pytest.mark.asyncio async def test_update_master_async( transport: str = "grpc_asyncio", request_type=cluster_service.UpdateMasterRequest @@ -3593,6 +3782,22 @@ def test_set_master_auth_from_dict(): test_set_master_auth(request_type=dict) +def test_set_master_auth_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_master_auth), "__call__") as call: + client.set_master_auth() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetMasterAuthRequest() + + @pytest.mark.asyncio async def test_set_master_auth_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetMasterAuthRequest @@ -3781,6 +3986,22 @@ def test_delete_cluster_from_dict(): test_delete_cluster(request_type=dict) +def test_delete_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_cluster), "__call__") as call: + client.delete_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.DeleteClusterRequest() + + @pytest.mark.asyncio async def test_delete_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.DeleteClusterRequest @@ -4036,6 +4257,22 @@ def test_list_operations_from_dict(): test_list_operations(request_type=dict) +def test_list_operations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + client.list_operations() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListOperationsRequest() + + @pytest.mark.asyncio async def test_list_operations_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListOperationsRequest @@ -4273,6 +4510,22 @@ def test_get_operation_from_dict(): test_get_operation(request_type=dict) +def test_get_operation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + client.get_operation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetOperationRequest() + + @pytest.mark.asyncio async def test_get_operation_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetOperationRequest @@ -4523,6 +4776,22 @@ def test_cancel_operation_from_dict(): test_cancel_operation(request_type=dict) +def test_cancel_operation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + client.cancel_operation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CancelOperationRequest() + + @pytest.mark.asyncio async def test_cancel_operation_async( transport: str = "grpc_asyncio", request_type=cluster_service.CancelOperationRequest @@ -4752,6 +5021,24 @@ def test_get_server_config_from_dict(): test_get_server_config(request_type=dict) +def test_get_server_config_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_server_config), "__call__" + ) as call: + client.get_server_config() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetServerConfigRequest() + + @pytest.mark.asyncio async def test_get_server_config_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetServerConfigRequest @@ -4985,6 +5272,24 @@ def test_get_json_web_keys_from_dict(): test_get_json_web_keys(request_type=dict) +def test_get_json_web_keys_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + client.get_json_web_keys() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetJSONWebKeysRequest() + + @pytest.mark.asyncio async def test_get_json_web_keys_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetJSONWebKeysRequest @@ -5111,6 +5416,22 @@ def test_list_node_pools_from_dict(): test_list_node_pools(request_type=dict) +def test_list_node_pools_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_node_pools), "__call__") as call: + client.list_node_pools() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListNodePoolsRequest() + + @pytest.mark.asyncio async def test_list_node_pools_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListNodePoolsRequest @@ -5356,6 +5677,22 @@ def test_get_node_pool_from_dict(): test_get_node_pool(request_type=dict) +def test_get_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_node_pool), "__call__") as call: + client.get_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetNodePoolRequest() + + @pytest.mark.asyncio async def test_get_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetNodePoolRequest @@ -5643,6 +5980,22 @@ def test_create_node_pool_from_dict(): test_create_node_pool(request_type=dict) +def test_create_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.create_node_pool), "__call__") as call: + client.create_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CreateNodePoolRequest() + + @pytest.mark.asyncio async def test_create_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.CreateNodePoolRequest @@ -5936,6 +6289,22 @@ def test_delete_node_pool_from_dict(): test_delete_node_pool(request_type=dict) +def test_delete_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_node_pool), "__call__") as call: + client.delete_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.DeleteNodePoolRequest() + + @pytest.mark.asyncio async def test_delete_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.DeleteNodePoolRequest @@ -6231,6 +6600,24 @@ def test_rollback_node_pool_upgrade_from_dict(): test_rollback_node_pool_upgrade(request_type=dict) +def test_rollback_node_pool_upgrade_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.rollback_node_pool_upgrade), "__call__" + ) as call: + client.rollback_node_pool_upgrade() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.RollbackNodePoolUpgradeRequest() + + @pytest.mark.asyncio async def test_rollback_node_pool_upgrade_async( transport: str = "grpc_asyncio", @@ -6537,6 +6924,24 @@ def test_set_node_pool_management_from_dict(): test_set_node_pool_management(request_type=dict) +def test_set_node_pool_management_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_node_pool_management), "__call__" + ) as call: + client.set_node_pool_management() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNodePoolManagementRequest() + + @pytest.mark.asyncio async def test_set_node_pool_management_async( transport: str = "grpc_asyncio", @@ -6732,6 +7137,22 @@ def test_set_labels_from_dict(): test_set_labels(request_type=dict) +def test_set_labels_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_labels), "__call__") as call: + client.set_labels() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLabelsRequest() + + @pytest.mark.asyncio async def test_set_labels_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetLabelsRequest @@ -6920,6 +7341,22 @@ def test_set_legacy_abac_from_dict(): test_set_legacy_abac(request_type=dict) +def test_set_legacy_abac_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_legacy_abac), "__call__") as call: + client.set_legacy_abac() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLegacyAbacRequest() + + @pytest.mark.asyncio async def test_set_legacy_abac_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetLegacyAbacRequest @@ -7215,6 +7652,24 @@ def test_start_ip_rotation_from_dict(): test_start_ip_rotation(request_type=dict) +def test_start_ip_rotation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.start_ip_rotation), "__call__" + ) as call: + client.start_ip_rotation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.StartIPRotationRequest() + + @pytest.mark.asyncio async def test_start_ip_rotation_async( transport: str = "grpc_asyncio", request_type=cluster_service.StartIPRotationRequest @@ -7512,6 +7967,24 @@ def test_complete_ip_rotation_from_dict(): test_complete_ip_rotation(request_type=dict) +def test_complete_ip_rotation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_ip_rotation), "__call__" + ) as call: + client.complete_ip_rotation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CompleteIPRotationRequest() + + @pytest.mark.asyncio async def test_complete_ip_rotation_async( transport: str = "grpc_asyncio", @@ -7810,6 +8283,24 @@ def test_set_node_pool_size_from_dict(): test_set_node_pool_size(request_type=dict) +def test_set_node_pool_size_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_node_pool_size), "__call__" + ) as call: + client.set_node_pool_size() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNodePoolSizeRequest() + + @pytest.mark.asyncio async def test_set_node_pool_size_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetNodePoolSizeRequest @@ -8006,6 +8497,24 @@ def test_set_network_policy_from_dict(): test_set_network_policy(request_type=dict) +def test_set_network_policy_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_network_policy), "__call__" + ) as call: + client.set_network_policy() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNetworkPolicyRequest() + + @pytest.mark.asyncio async def test_set_network_policy_async( transport: str = "grpc_asyncio", @@ -8324,6 +8833,24 @@ def test_set_maintenance_policy_from_dict(): test_set_maintenance_policy(request_type=dict) +def test_set_maintenance_policy_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_maintenance_policy), "__call__" + ) as call: + client.set_maintenance_policy() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetMaintenancePolicyRequest() + + @pytest.mark.asyncio async def test_set_maintenance_policy_async( transport: str = "grpc_asyncio", @@ -8636,6 +9163,24 @@ def test_list_usable_subnetworks_from_dict(): test_list_usable_subnetworks(request_type=dict) +def test_list_usable_subnetworks_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_usable_subnetworks), "__call__" + ) as call: + client.list_usable_subnetworks() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListUsableSubnetworksRequest() + + @pytest.mark.asyncio async def test_list_usable_subnetworks_async( transport: str = "grpc_asyncio", @@ -9094,6 +9639,51 @@ def test_cluster_manager_transport_auth_adc(): ) +@pytest.mark.parametrize( + "transport_class", + [ + transports.ClusterManagerGrpcTransport, + transports.ClusterManagerGrpcAsyncIOTransport, + ], +) +def test_cluster_manager_grpc_transport_client_cert_source_for_mtls(transport_class): + cred = credentials.AnonymousCredentials() + + # Check ssl_channel_credentials is used if provided. + with mock.patch.object(transport_class, "create_channel") as mock_create_channel: + mock_ssl_channel_creds = mock.Mock() + transport_class( + host="squid.clam.whelk", + credentials=cred, + ssl_channel_credentials=mock_ssl_channel_creds, + ) + mock_create_channel.assert_called_once_with( + "squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=("https://www.googleapis.com/auth/cloud-platform",), + ssl_credentials=mock_ssl_channel_creds, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls + # is used. + with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): + with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: + transport_class( + credentials=cred, + client_cert_source_for_mtls=client_cert_source_callback, + ) + expected_cert, expected_key = client_cert_source_callback() + mock_ssl_cred.assert_called_once_with( + certificate_chain=expected_cert, private_key=expected_key + ) + + def test_cluster_manager_host_no_port(): client = ClusterManagerClient( credentials=credentials.AnonymousCredentials(), @@ -9115,7 +9705,7 @@ def test_cluster_manager_host_with_port(): def test_cluster_manager_grpc_transport_channel(): - channel = grpc.insecure_channel("http://localhost/") + channel = grpc.secure_channel("http://localhost/", grpc.local_channel_credentials()) # Check that channel is used if provided. transport = transports.ClusterManagerGrpcTransport( @@ -9127,7 +9717,7 @@ def test_cluster_manager_grpc_transport_channel(): def test_cluster_manager_grpc_asyncio_transport_channel(): - channel = aio.insecure_channel("http://localhost/") + channel = aio.secure_channel("http://localhost/", grpc.local_channel_credentials()) # Check that channel is used if provided. transport = transports.ClusterManagerGrpcAsyncIOTransport( @@ -9138,6 +9728,8 @@ def test_cluster_manager_grpc_asyncio_transport_channel(): assert transport._ssl_channel_credentials == None +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. @pytest.mark.parametrize( "transport_class", [ @@ -9152,7 +9744,7 @@ def test_cluster_manager_transport_channel_mtls_with_client_cert_source( "grpc.ssl_channel_credentials", autospec=True ) as grpc_ssl_channel_cred: with mock.patch.object( - transport_class, "create_channel", autospec=True + transport_class, "create_channel" ) as grpc_create_channel: mock_ssl_cred = mock.Mock() grpc_ssl_channel_cred.return_value = mock_ssl_cred @@ -9190,6 +9782,8 @@ def test_cluster_manager_transport_channel_mtls_with_client_cert_source( assert transport._ssl_channel_credentials == mock_ssl_cred +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. @pytest.mark.parametrize( "transport_class", [ @@ -9205,7 +9799,7 @@ def test_cluster_manager_transport_channel_mtls_with_adc(transport_class): ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), ): with mock.patch.object( - transport_class, "create_channel", autospec=True + transport_class, "create_channel" ) as grpc_create_channel: mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel diff --git a/tests/unit/gapic/container_v1beta1/__init__.py b/tests/unit/gapic/container_v1beta1/__init__.py index 8b137891..42ffdf2b 100644 --- a/tests/unit/gapic/container_v1beta1/__init__.py +++ b/tests/unit/gapic/container_v1beta1/__init__.py @@ -1 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/tests/unit/gapic/container_v1beta1/test_cluster_manager.py b/tests/unit/gapic/container_v1beta1/test_cluster_manager.py index ba526cb9..20a19f37 100644 --- a/tests/unit/gapic/container_v1beta1/test_cluster_manager.py +++ b/tests/unit/gapic/container_v1beta1/test_cluster_manager.py @@ -91,7 +91,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [ClusterManagerClient, ClusterManagerAsyncClient] + "client_class", [ClusterManagerClient, ClusterManagerAsyncClient,] +) +def test_cluster_manager_client_from_service_account_info(client_class): + creds = credentials.AnonymousCredentials() + with mock.patch.object( + service_account.Credentials, "from_service_account_info" + ) as factory: + factory.return_value = creds + info = {"valid": True} + client = client_class.from_service_account_info(info) + assert client.transport._credentials == creds + assert isinstance(client, client_class) + + assert client.transport._host == "container.googleapis.com:443" + + +@pytest.mark.parametrize( + "client_class", [ClusterManagerClient, ClusterManagerAsyncClient,] ) def test_cluster_manager_client_from_service_account_file(client_class): creds = credentials.AnonymousCredentials() @@ -101,16 +118,21 @@ def test_cluster_manager_client_from_service_account_file(client_class): factory.return_value = creds client = client_class.from_service_account_file("dummy/file/path.json") assert client.transport._credentials == creds + assert isinstance(client, client_class) client = client_class.from_service_account_json("dummy/file/path.json") assert client.transport._credentials == creds + assert isinstance(client, client_class) assert client.transport._host == "container.googleapis.com:443" def test_cluster_manager_client_get_transport_class(): transport = ClusterManagerClient.get_transport_class() - assert transport == transports.ClusterManagerGrpcTransport + available_transports = [ + transports.ClusterManagerGrpcTransport, + ] + assert transport in available_transports transport = ClusterManagerClient.get_transport_class("grpc") assert transport == transports.ClusterManagerGrpcTransport @@ -161,7 +183,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host="squid.clam.whelk", scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -177,7 +199,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host=client.DEFAULT_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -193,7 +215,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host=client.DEFAULT_MTLS_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -221,7 +243,7 @@ def test_cluster_manager_client_client_options( credentials_file=None, host=client.DEFAULT_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id="octopus", client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -272,29 +294,25 @@ def test_cluster_manager_client_mtls_env_auto( client_cert_source=client_cert_source_callback ) with mock.patch.object(transport_class, "__init__") as patched: - ssl_channel_creds = mock.Mock() - with mock.patch( - "grpc.ssl_channel_credentials", return_value=ssl_channel_creds - ): - patched.return_value = None - client = client_class(client_options=options) + patched.return_value = None + client = client_class(client_options=options) - if use_client_cert_env == "false": - expected_ssl_channel_creds = None - expected_host = client.DEFAULT_ENDPOINT - else: - expected_ssl_channel_creds = ssl_channel_creds - expected_host = client.DEFAULT_MTLS_ENDPOINT + if use_client_cert_env == "false": + expected_client_cert_source = None + expected_host = client.DEFAULT_ENDPOINT + else: + expected_client_cert_source = client_cert_source_callback + expected_host = client.DEFAULT_MTLS_ENDPOINT - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=expected_host, - scopes=None, - ssl_channel_credentials=expected_ssl_channel_creds, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - ) + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=expected_host, + scopes=None, + client_cert_source_for_mtls=expected_client_cert_source, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + ) # Check the case ADC client cert is provided. Whether client cert is used depends on # GOOGLE_API_USE_CLIENT_CERTIFICATE value. @@ -303,66 +321,53 @@ def test_cluster_manager_client_mtls_env_auto( ): with mock.patch.object(transport_class, "__init__") as patched: with mock.patch( - "google.auth.transport.grpc.SslCredentials.__init__", return_value=None + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, ): with mock.patch( - "google.auth.transport.grpc.SslCredentials.is_mtls", - new_callable=mock.PropertyMock, - ) as is_mtls_mock: - with mock.patch( - "google.auth.transport.grpc.SslCredentials.ssl_credentials", - new_callable=mock.PropertyMock, - ) as ssl_credentials_mock: - if use_client_cert_env == "false": - is_mtls_mock.return_value = False - ssl_credentials_mock.return_value = None - expected_host = client.DEFAULT_ENDPOINT - expected_ssl_channel_creds = None - else: - is_mtls_mock.return_value = True - ssl_credentials_mock.return_value = mock.Mock() - expected_host = client.DEFAULT_MTLS_ENDPOINT - expected_ssl_channel_creds = ( - ssl_credentials_mock.return_value - ) - - patched.return_value = None - client = client_class() - patched.assert_called_once_with( - credentials=None, - credentials_file=None, - host=expected_host, - scopes=None, - ssl_channel_credentials=expected_ssl_channel_creds, - quota_project_id=None, - client_info=transports.base.DEFAULT_CLIENT_INFO, - ) + "google.auth.transport.mtls.default_client_cert_source", + return_value=client_cert_source_callback, + ): + if use_client_cert_env == "false": + expected_host = client.DEFAULT_ENDPOINT + expected_client_cert_source = None + else: + expected_host = client.DEFAULT_MTLS_ENDPOINT + expected_client_cert_source = client_cert_source_callback - # Check the case client_cert_source and ADC client cert are not provided. - with mock.patch.dict( - os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} - ): - with mock.patch.object(transport_class, "__init__") as patched: - with mock.patch( - "google.auth.transport.grpc.SslCredentials.__init__", return_value=None - ): - with mock.patch( - "google.auth.transport.grpc.SslCredentials.is_mtls", - new_callable=mock.PropertyMock, - ) as is_mtls_mock: - is_mtls_mock.return_value = False patched.return_value = None client = client_class() patched.assert_called_once_with( credentials=None, credentials_file=None, - host=client.DEFAULT_ENDPOINT, + host=expected_host, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=expected_client_cert_source, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) + # Check the case client_cert_source and ADC client cert are not provided. + with mock.patch.dict( + os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": use_client_cert_env} + ): + with mock.patch.object(transport_class, "__init__") as patched: + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + patched.return_value = None + client = client_class() + patched.assert_called_once_with( + credentials=None, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + ) + @pytest.mark.parametrize( "client_class,transport_class,transport_name", @@ -388,7 +393,7 @@ def test_cluster_manager_client_client_options_scopes( credentials_file=None, host=client.DEFAULT_ENDPOINT, scopes=["1", "2"], - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -418,7 +423,7 @@ def test_cluster_manager_client_client_options_credentials_file( credentials_file="credentials.json", host=client.DEFAULT_ENDPOINT, scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -437,7 +442,7 @@ def test_cluster_manager_client_client_options_from_dict(): credentials_file=None, host="squid.clam.whelk", scopes=None, - ssl_channel_credentials=None, + client_cert_source_for_mtls=None, quota_project_id=None, client_info=transports.base.DEFAULT_CLIENT_INFO, ) @@ -480,6 +485,22 @@ def test_list_clusters_from_dict(): test_list_clusters(request_type=dict) +def test_list_clusters_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_clusters), "__call__") as call: + client.list_clusters() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListClustersRequest() + + @pytest.mark.asyncio async def test_list_clusters_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListClustersRequest @@ -772,6 +793,22 @@ def test_get_cluster_from_dict(): test_get_cluster(request_type=dict) +def test_get_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_cluster), "__call__") as call: + client.get_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetClusterRequest() + + @pytest.mark.asyncio async def test_get_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetClusterRequest @@ -1106,6 +1143,22 @@ def test_create_cluster_from_dict(): test_create_cluster(request_type=dict) +def test_create_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.create_cluster), "__call__") as call: + client.create_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CreateClusterRequest() + + @pytest.mark.asyncio async def test_create_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.CreateClusterRequest @@ -1383,6 +1436,22 @@ def test_update_cluster_from_dict(): test_update_cluster(request_type=dict) +def test_update_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.update_cluster), "__call__") as call: + client.update_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.UpdateClusterRequest() + + @pytest.mark.asyncio async def test_update_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.UpdateClusterRequest @@ -1680,6 +1749,22 @@ def test_update_node_pool_from_dict(): test_update_node_pool(request_type=dict) +def test_update_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.update_node_pool), "__call__") as call: + client.update_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.UpdateNodePoolRequest() + + @pytest.mark.asyncio async def test_update_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.UpdateNodePoolRequest @@ -1870,6 +1955,24 @@ def test_set_node_pool_autoscaling_from_dict(): test_set_node_pool_autoscaling(request_type=dict) +def test_set_node_pool_autoscaling_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_node_pool_autoscaling), "__call__" + ) as call: + client.set_node_pool_autoscaling() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNodePoolAutoscalingRequest() + + @pytest.mark.asyncio async def test_set_node_pool_autoscaling_async( transport: str = "grpc_asyncio", @@ -2067,6 +2170,24 @@ def test_set_logging_service_from_dict(): test_set_logging_service(request_type=dict) +def test_set_logging_service_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_logging_service), "__call__" + ) as call: + client.set_logging_service() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLoggingServiceRequest() + + @pytest.mark.asyncio async def test_set_logging_service_async( transport: str = "grpc_asyncio", @@ -2365,6 +2486,24 @@ def test_set_monitoring_service_from_dict(): test_set_monitoring_service(request_type=dict) +def test_set_monitoring_service_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_monitoring_service), "__call__" + ) as call: + client.set_monitoring_service() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetMonitoringServiceRequest() + + @pytest.mark.asyncio async def test_set_monitoring_service_async( transport: str = "grpc_asyncio", @@ -2663,6 +2802,24 @@ def test_set_addons_config_from_dict(): test_set_addons_config(request_type=dict) +def test_set_addons_config_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_addons_config), "__call__" + ) as call: + client.set_addons_config() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetAddonsConfigRequest() + + @pytest.mark.asyncio async def test_set_addons_config_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetAddonsConfigRequest @@ -2970,6 +3127,22 @@ def test_set_locations_from_dict(): test_set_locations(request_type=dict) +def test_set_locations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_locations), "__call__") as call: + client.set_locations() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLocationsRequest() + + @pytest.mark.asyncio async def test_set_locations_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetLocationsRequest @@ -3255,6 +3428,22 @@ def test_update_master_from_dict(): test_update_master(request_type=dict) +def test_update_master_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.update_master), "__call__") as call: + client.update_master() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.UpdateMasterRequest() + + @pytest.mark.asyncio async def test_update_master_async( transport: str = "grpc_asyncio", request_type=cluster_service.UpdateMasterRequest @@ -3540,6 +3729,22 @@ def test_set_master_auth_from_dict(): test_set_master_auth(request_type=dict) +def test_set_master_auth_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_master_auth), "__call__") as call: + client.set_master_auth() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetMasterAuthRequest() + + @pytest.mark.asyncio async def test_set_master_auth_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetMasterAuthRequest @@ -3728,6 +3933,22 @@ def test_delete_cluster_from_dict(): test_delete_cluster(request_type=dict) +def test_delete_cluster_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_cluster), "__call__") as call: + client.delete_cluster() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.DeleteClusterRequest() + + @pytest.mark.asyncio async def test_delete_cluster_async( transport: str = "grpc_asyncio", request_type=cluster_service.DeleteClusterRequest @@ -3975,6 +4196,22 @@ def test_list_operations_from_dict(): test_list_operations(request_type=dict) +def test_list_operations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_operations), "__call__") as call: + client.list_operations() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListOperationsRequest() + + @pytest.mark.asyncio async def test_list_operations_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListOperationsRequest @@ -4212,6 +4449,22 @@ def test_get_operation_from_dict(): test_get_operation(request_type=dict) +def test_get_operation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_operation), "__call__") as call: + client.get_operation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetOperationRequest() + + @pytest.mark.asyncio async def test_get_operation_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetOperationRequest @@ -4454,6 +4707,22 @@ def test_cancel_operation_from_dict(): test_cancel_operation(request_type=dict) +def test_cancel_operation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.cancel_operation), "__call__") as call: + client.cancel_operation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CancelOperationRequest() + + @pytest.mark.asyncio async def test_cancel_operation_async( transport: str = "grpc_asyncio", request_type=cluster_service.CancelOperationRequest @@ -4675,6 +4944,24 @@ def test_get_server_config_from_dict(): test_get_server_config(request_type=dict) +def test_get_server_config_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_server_config), "__call__" + ) as call: + client.get_server_config() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetServerConfigRequest() + + @pytest.mark.asyncio async def test_get_server_config_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetServerConfigRequest @@ -4900,6 +5187,22 @@ def test_list_node_pools_from_dict(): test_list_node_pools(request_type=dict) +def test_list_node_pools_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_node_pools), "__call__") as call: + client.list_node_pools() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListNodePoolsRequest() + + @pytest.mark.asyncio async def test_list_node_pools_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListNodePoolsRequest @@ -5111,6 +5414,24 @@ def test_get_json_web_keys_from_dict(): test_get_json_web_keys(request_type=dict) +def test_get_json_web_keys_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.get_json_web_keys), "__call__" + ) as call: + client.get_json_web_keys() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetJSONWebKeysRequest() + + @pytest.mark.asyncio async def test_get_json_web_keys_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetJSONWebKeysRequest @@ -5265,6 +5586,22 @@ def test_get_node_pool_from_dict(): test_get_node_pool(request_type=dict) +def test_get_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_node_pool), "__call__") as call: + client.get_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.GetNodePoolRequest() + + @pytest.mark.asyncio async def test_get_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.GetNodePoolRequest @@ -5544,6 +5881,22 @@ def test_create_node_pool_from_dict(): test_create_node_pool(request_type=dict) +def test_create_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.create_node_pool), "__call__") as call: + client.create_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CreateNodePoolRequest() + + @pytest.mark.asyncio async def test_create_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.CreateNodePoolRequest @@ -5829,6 +6182,22 @@ def test_delete_node_pool_from_dict(): test_delete_node_pool(request_type=dict) +def test_delete_node_pool_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.delete_node_pool), "__call__") as call: + client.delete_node_pool() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.DeleteNodePoolRequest() + + @pytest.mark.asyncio async def test_delete_node_pool_async( transport: str = "grpc_asyncio", request_type=cluster_service.DeleteNodePoolRequest @@ -6116,6 +6485,24 @@ def test_rollback_node_pool_upgrade_from_dict(): test_rollback_node_pool_upgrade(request_type=dict) +def test_rollback_node_pool_upgrade_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.rollback_node_pool_upgrade), "__call__" + ) as call: + client.rollback_node_pool_upgrade() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.RollbackNodePoolUpgradeRequest() + + @pytest.mark.asyncio async def test_rollback_node_pool_upgrade_async( transport: str = "grpc_asyncio", @@ -6414,6 +6801,24 @@ def test_set_node_pool_management_from_dict(): test_set_node_pool_management(request_type=dict) +def test_set_node_pool_management_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_node_pool_management), "__call__" + ) as call: + client.set_node_pool_management() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNodePoolManagementRequest() + + @pytest.mark.asyncio async def test_set_node_pool_management_async( transport: str = "grpc_asyncio", @@ -6718,6 +7123,22 @@ def test_set_labels_from_dict(): test_set_labels(request_type=dict) +def test_set_labels_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_labels), "__call__") as call: + client.set_labels() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLabelsRequest() + + @pytest.mark.asyncio async def test_set_labels_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetLabelsRequest @@ -7011,6 +7432,22 @@ def test_set_legacy_abac_from_dict(): test_set_legacy_abac(request_type=dict) +def test_set_legacy_abac_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.set_legacy_abac), "__call__") as call: + client.set_legacy_abac() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetLegacyAbacRequest() + + @pytest.mark.asyncio async def test_set_legacy_abac_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetLegacyAbacRequest @@ -7298,6 +7735,24 @@ def test_start_ip_rotation_from_dict(): test_start_ip_rotation(request_type=dict) +def test_start_ip_rotation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.start_ip_rotation), "__call__" + ) as call: + client.start_ip_rotation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.StartIPRotationRequest() + + @pytest.mark.asyncio async def test_start_ip_rotation_async( transport: str = "grpc_asyncio", request_type=cluster_service.StartIPRotationRequest @@ -7587,6 +8042,24 @@ def test_complete_ip_rotation_from_dict(): test_complete_ip_rotation(request_type=dict) +def test_complete_ip_rotation_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_ip_rotation), "__call__" + ) as call: + client.complete_ip_rotation() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.CompleteIPRotationRequest() + + @pytest.mark.asyncio async def test_complete_ip_rotation_async( transport: str = "grpc_asyncio", @@ -7877,6 +8350,24 @@ def test_set_node_pool_size_from_dict(): test_set_node_pool_size(request_type=dict) +def test_set_node_pool_size_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_node_pool_size), "__call__" + ) as call: + client.set_node_pool_size() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNodePoolSizeRequest() + + @pytest.mark.asyncio async def test_set_node_pool_size_async( transport: str = "grpc_asyncio", request_type=cluster_service.SetNodePoolSizeRequest @@ -8073,6 +8564,24 @@ def test_set_network_policy_from_dict(): test_set_network_policy(request_type=dict) +def test_set_network_policy_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_network_policy), "__call__" + ) as call: + client.set_network_policy() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetNetworkPolicyRequest() + + @pytest.mark.asyncio async def test_set_network_policy_async( transport: str = "grpc_asyncio", @@ -8383,6 +8892,24 @@ def test_set_maintenance_policy_from_dict(): test_set_maintenance_policy(request_type=dict) +def test_set_maintenance_policy_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.set_maintenance_policy), "__call__" + ) as call: + client.set_maintenance_policy() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.SetMaintenancePolicyRequest() + + @pytest.mark.asyncio async def test_set_maintenance_policy_async( transport: str = "grpc_asyncio", @@ -8687,6 +9214,24 @@ def test_list_usable_subnetworks_from_dict(): test_list_usable_subnetworks(request_type=dict) +def test_list_usable_subnetworks_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.list_usable_subnetworks), "__call__" + ) as call: + client.list_usable_subnetworks() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListUsableSubnetworksRequest() + + @pytest.mark.asyncio async def test_list_usable_subnetworks_async( transport: str = "grpc_asyncio", @@ -9065,6 +9610,22 @@ def test_list_locations_from_dict(): test_list_locations(request_type=dict) +def test_list_locations_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = ClusterManagerClient( + credentials=credentials.AnonymousCredentials(), transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.list_locations), "__call__") as call: + client.list_locations() + call.assert_called() + _, args, _ = call.mock_calls[0] + + assert args[0] == cluster_service.ListLocationsRequest() + + @pytest.mark.asyncio async def test_list_locations_async( transport: str = "grpc_asyncio", request_type=cluster_service.ListLocationsRequest @@ -9414,6 +9975,51 @@ def test_cluster_manager_transport_auth_adc(): ) +@pytest.mark.parametrize( + "transport_class", + [ + transports.ClusterManagerGrpcTransport, + transports.ClusterManagerGrpcAsyncIOTransport, + ], +) +def test_cluster_manager_grpc_transport_client_cert_source_for_mtls(transport_class): + cred = credentials.AnonymousCredentials() + + # Check ssl_channel_credentials is used if provided. + with mock.patch.object(transport_class, "create_channel") as mock_create_channel: + mock_ssl_channel_creds = mock.Mock() + transport_class( + host="squid.clam.whelk", + credentials=cred, + ssl_channel_credentials=mock_ssl_channel_creds, + ) + mock_create_channel.assert_called_once_with( + "squid.clam.whelk:443", + credentials=cred, + credentials_file=None, + scopes=("https://www.googleapis.com/auth/cloud-platform",), + ssl_credentials=mock_ssl_channel_creds, + quota_project_id=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + # Check if ssl_channel_credentials is not provided, then client_cert_source_for_mtls + # is used. + with mock.patch.object(transport_class, "create_channel", return_value=mock.Mock()): + with mock.patch("grpc.ssl_channel_credentials") as mock_ssl_cred: + transport_class( + credentials=cred, + client_cert_source_for_mtls=client_cert_source_callback, + ) + expected_cert, expected_key = client_cert_source_callback() + mock_ssl_cred.assert_called_once_with( + certificate_chain=expected_cert, private_key=expected_key + ) + + def test_cluster_manager_host_no_port(): client = ClusterManagerClient( credentials=credentials.AnonymousCredentials(), @@ -9435,7 +10041,7 @@ def test_cluster_manager_host_with_port(): def test_cluster_manager_grpc_transport_channel(): - channel = grpc.insecure_channel("http://localhost/") + channel = grpc.secure_channel("http://localhost/", grpc.local_channel_credentials()) # Check that channel is used if provided. transport = transports.ClusterManagerGrpcTransport( @@ -9447,7 +10053,7 @@ def test_cluster_manager_grpc_transport_channel(): def test_cluster_manager_grpc_asyncio_transport_channel(): - channel = aio.insecure_channel("http://localhost/") + channel = aio.secure_channel("http://localhost/", grpc.local_channel_credentials()) # Check that channel is used if provided. transport = transports.ClusterManagerGrpcAsyncIOTransport( @@ -9458,6 +10064,8 @@ def test_cluster_manager_grpc_asyncio_transport_channel(): assert transport._ssl_channel_credentials == None +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. @pytest.mark.parametrize( "transport_class", [ @@ -9472,7 +10080,7 @@ def test_cluster_manager_transport_channel_mtls_with_client_cert_source( "grpc.ssl_channel_credentials", autospec=True ) as grpc_ssl_channel_cred: with mock.patch.object( - transport_class, "create_channel", autospec=True + transport_class, "create_channel" ) as grpc_create_channel: mock_ssl_cred = mock.Mock() grpc_ssl_channel_cred.return_value = mock_ssl_cred @@ -9510,6 +10118,8 @@ def test_cluster_manager_transport_channel_mtls_with_client_cert_source( assert transport._ssl_channel_credentials == mock_ssl_cred +# Remove this test when deprecated arguments (api_mtls_endpoint, client_cert_source) are +# removed from grpc/grpc_asyncio transport constructor. @pytest.mark.parametrize( "transport_class", [ @@ -9525,7 +10135,7 @@ def test_cluster_manager_transport_channel_mtls_with_adc(transport_class): ssl_credentials=mock.PropertyMock(return_value=mock_ssl_cred), ): with mock.patch.object( - transport_class, "create_channel", autospec=True + transport_class, "create_channel" ) as grpc_create_channel: mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel