|
35 | 35 | from google.api_core.client_options import ClientOptions |
36 | 36 | from google.auth import credentials as ga_credentials # type: ignore |
37 | 37 | from google.oauth2 import service_account # type: ignore |
38 | | -import pkg_resources |
| 38 | + |
| 39 | +from google.cloud.container_v1 import gapic_version as package_version |
39 | 40 |
|
40 | 41 | try: |
41 | 42 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -224,7 +225,7 @@ async def list_clusters( |
224 | 225 | zone: Optional[str] = None, |
225 | 226 | parent: Optional[str] = None, |
226 | 227 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
227 | | - timeout: Optional[float] = None, |
| 228 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
228 | 229 | metadata: Sequence[Tuple[str, str]] = (), |
229 | 230 | ) -> cluster_service.ListClustersResponse: |
230 | 231 | r"""Lists all clusters owned by a project in either the |
@@ -364,7 +365,7 @@ async def get_cluster( |
364 | 365 | cluster_id: Optional[str] = None, |
365 | 366 | name: Optional[str] = None, |
366 | 367 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
367 | | - timeout: Optional[float] = None, |
| 368 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
368 | 369 | metadata: Sequence[Tuple[str, str]] = (), |
369 | 370 | ) -> cluster_service.Cluster: |
370 | 371 | r"""Gets the details of a specific cluster. |
@@ -511,7 +512,7 @@ async def create_cluster( |
511 | 512 | cluster: Optional[cluster_service.Cluster] = None, |
512 | 513 | parent: Optional[str] = None, |
513 | 514 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
514 | | - timeout: Optional[float] = None, |
| 515 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
515 | 516 | metadata: Sequence[Tuple[str, str]] = (), |
516 | 517 | ) -> cluster_service.Operation: |
517 | 518 | r"""Creates a cluster, consisting of the specified number and type |
@@ -663,7 +664,7 @@ async def update_cluster( |
663 | 664 | update: Optional[cluster_service.ClusterUpdate] = None, |
664 | 665 | name: Optional[str] = None, |
665 | 666 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
666 | | - timeout: Optional[float] = None, |
| 667 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
667 | 668 | metadata: Sequence[Tuple[str, str]] = (), |
668 | 669 | ) -> cluster_service.Operation: |
669 | 670 | r"""Updates the settings of a specific cluster. |
@@ -809,7 +810,7 @@ async def update_node_pool( |
809 | 810 | request: Optional[Union[cluster_service.UpdateNodePoolRequest, dict]] = None, |
810 | 811 | *, |
811 | 812 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
812 | | - timeout: Optional[float] = None, |
| 813 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
813 | 814 | metadata: Sequence[Tuple[str, str]] = (), |
814 | 815 | ) -> cluster_service.Operation: |
815 | 816 | r"""Updates the version and/or image type for the |
@@ -895,7 +896,7 @@ async def set_node_pool_autoscaling( |
895 | 896 | ] = None, |
896 | 897 | *, |
897 | 898 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
898 | | - timeout: Optional[float] = None, |
| 899 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
899 | 900 | metadata: Sequence[Tuple[str, str]] = (), |
900 | 901 | ) -> cluster_service.Operation: |
901 | 902 | r"""Sets the autoscaling settings for the specified node |
@@ -982,7 +983,7 @@ async def set_logging_service( |
982 | 983 | logging_service: Optional[str] = None, |
983 | 984 | name: Optional[str] = None, |
984 | 985 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
985 | | - timeout: Optional[float] = None, |
| 986 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
986 | 987 | metadata: Sequence[Tuple[str, str]] = (), |
987 | 988 | ) -> cluster_service.Operation: |
988 | 989 | r"""Sets the logging service for a specific cluster. |
@@ -1150,7 +1151,7 @@ async def set_monitoring_service( |
1150 | 1151 | monitoring_service: Optional[str] = None, |
1151 | 1152 | name: Optional[str] = None, |
1152 | 1153 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1153 | | - timeout: Optional[float] = None, |
| 1154 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1154 | 1155 | metadata: Sequence[Tuple[str, str]] = (), |
1155 | 1156 | ) -> cluster_service.Operation: |
1156 | 1157 | r"""Sets the monitoring service for a specific cluster. |
@@ -1318,7 +1319,7 @@ async def set_addons_config( |
1318 | 1319 | addons_config: Optional[cluster_service.AddonsConfig] = None, |
1319 | 1320 | name: Optional[str] = None, |
1320 | 1321 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1321 | | - timeout: Optional[float] = None, |
| 1322 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1322 | 1323 | metadata: Sequence[Tuple[str, str]] = (), |
1323 | 1324 | ) -> cluster_service.Operation: |
1324 | 1325 | r"""Sets the addons for a specific cluster. |
@@ -1470,7 +1471,7 @@ async def set_locations( |
1470 | 1471 | locations: Optional[MutableSequence[str]] = None, |
1471 | 1472 | name: Optional[str] = None, |
1472 | 1473 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1473 | | - timeout: Optional[float] = None, |
| 1474 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1474 | 1475 | metadata: Sequence[Tuple[str, str]] = (), |
1475 | 1476 | ) -> cluster_service.Operation: |
1476 | 1477 | r"""Sets the locations for a specific cluster. Deprecated. Use |
@@ -1635,7 +1636,7 @@ async def update_master( |
1635 | 1636 | master_version: Optional[str] = None, |
1636 | 1637 | name: Optional[str] = None, |
1637 | 1638 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1638 | | - timeout: Optional[float] = None, |
| 1639 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1639 | 1640 | metadata: Sequence[Tuple[str, str]] = (), |
1640 | 1641 | ) -> cluster_service.Operation: |
1641 | 1642 | r"""Updates the master for a specific cluster. |
@@ -1794,7 +1795,7 @@ async def set_master_auth( |
1794 | 1795 | request: Optional[Union[cluster_service.SetMasterAuthRequest, dict]] = None, |
1795 | 1796 | *, |
1796 | 1797 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1797 | | - timeout: Optional[float] = None, |
| 1798 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1798 | 1799 | metadata: Sequence[Tuple[str, str]] = (), |
1799 | 1800 | ) -> cluster_service.Operation: |
1800 | 1801 | r"""Sets master auth materials. Currently supports |
@@ -1883,7 +1884,7 @@ async def delete_cluster( |
1883 | 1884 | cluster_id: Optional[str] = None, |
1884 | 1885 | name: Optional[str] = None, |
1885 | 1886 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1886 | | - timeout: Optional[float] = None, |
| 1887 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1887 | 1888 | metadata: Sequence[Tuple[str, str]] = (), |
1888 | 1889 | ) -> cluster_service.Operation: |
1889 | 1890 | r"""Deletes the cluster, including the Kubernetes |
@@ -2041,7 +2042,7 @@ async def list_operations( |
2041 | 2042 | project_id: Optional[str] = None, |
2042 | 2043 | zone: Optional[str] = None, |
2043 | 2044 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2044 | | - timeout: Optional[float] = None, |
| 2045 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2045 | 2046 | metadata: Sequence[Tuple[str, str]] = (), |
2046 | 2047 | ) -> cluster_service.ListOperationsResponse: |
2047 | 2048 | r"""Lists all operations in a project in a specific zone |
@@ -2171,7 +2172,7 @@ async def get_operation( |
2171 | 2172 | operation_id: Optional[str] = None, |
2172 | 2173 | name: Optional[str] = None, |
2173 | 2174 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2174 | | - timeout: Optional[float] = None, |
| 2175 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2175 | 2176 | metadata: Sequence[Tuple[str, str]] = (), |
2176 | 2177 | ) -> cluster_service.Operation: |
2177 | 2178 | r"""Gets the specified operation. |
@@ -2321,7 +2322,7 @@ async def cancel_operation( |
2321 | 2322 | operation_id: Optional[str] = None, |
2322 | 2323 | name: Optional[str] = None, |
2323 | 2324 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2324 | | - timeout: Optional[float] = None, |
| 2325 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2325 | 2326 | metadata: Sequence[Tuple[str, str]] = (), |
2326 | 2327 | ) -> None: |
2327 | 2328 | r"""Cancels the specified operation. |
@@ -2446,7 +2447,7 @@ async def get_server_config( |
2446 | 2447 | zone: Optional[str] = None, |
2447 | 2448 | name: Optional[str] = None, |
2448 | 2449 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2449 | | - timeout: Optional[float] = None, |
| 2450 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2450 | 2451 | metadata: Sequence[Tuple[str, str]] = (), |
2451 | 2452 | ) -> cluster_service.ServerConfig: |
2452 | 2453 | r"""Returns configuration info about the Google |
@@ -2580,7 +2581,7 @@ async def get_json_web_keys( |
2580 | 2581 | request: Optional[Union[cluster_service.GetJSONWebKeysRequest, dict]] = None, |
2581 | 2582 | *, |
2582 | 2583 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2583 | | - timeout: Optional[float] = None, |
| 2584 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2584 | 2585 | metadata: Sequence[Tuple[str, str]] = (), |
2585 | 2586 | ) -> cluster_service.GetJSONWebKeysResponse: |
2586 | 2587 | r"""Gets the public component of the cluster signing keys |
@@ -2670,7 +2671,7 @@ async def list_node_pools( |
2670 | 2671 | cluster_id: Optional[str] = None, |
2671 | 2672 | parent: Optional[str] = None, |
2672 | 2673 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2673 | | - timeout: Optional[float] = None, |
| 2674 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2674 | 2675 | metadata: Sequence[Tuple[str, str]] = (), |
2675 | 2676 | ) -> cluster_service.ListNodePoolsResponse: |
2676 | 2677 | r"""Lists the node pools for a cluster. |
@@ -2819,7 +2820,7 @@ async def get_node_pool( |
2819 | 2820 | node_pool_id: Optional[str] = None, |
2820 | 2821 | name: Optional[str] = None, |
2821 | 2822 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2822 | | - timeout: Optional[float] = None, |
| 2823 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2823 | 2824 | metadata: Sequence[Tuple[str, str]] = (), |
2824 | 2825 | ) -> cluster_service.NodePool: |
2825 | 2826 | r"""Retrieves the requested node pool. |
@@ -2986,7 +2987,7 @@ async def create_node_pool( |
2986 | 2987 | node_pool: Optional[cluster_service.NodePool] = None, |
2987 | 2988 | parent: Optional[str] = None, |
2988 | 2989 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2989 | | - timeout: Optional[float] = None, |
| 2990 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2990 | 2991 | metadata: Sequence[Tuple[str, str]] = (), |
2991 | 2992 | ) -> cluster_service.Operation: |
2992 | 2993 | r"""Creates a node pool for a cluster. |
@@ -3134,7 +3135,7 @@ async def delete_node_pool( |
3134 | 3135 | node_pool_id: Optional[str] = None, |
3135 | 3136 | name: Optional[str] = None, |
3136 | 3137 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3137 | | - timeout: Optional[float] = None, |
| 3138 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3138 | 3139 | metadata: Sequence[Tuple[str, str]] = (), |
3139 | 3140 | ) -> cluster_service.Operation: |
3140 | 3141 | r"""Deletes a node pool from a cluster. |
@@ -3293,7 +3294,7 @@ async def complete_node_pool_upgrade( |
3293 | 3294 | ] = None, |
3294 | 3295 | *, |
3295 | 3296 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3296 | | - timeout: Optional[float] = None, |
| 3297 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3297 | 3298 | metadata: Sequence[Tuple[str, str]] = (), |
3298 | 3299 | ) -> None: |
3299 | 3300 | r"""CompleteNodePoolUpgrade will signal an on-going node |
@@ -3368,7 +3369,7 @@ async def rollback_node_pool_upgrade( |
3368 | 3369 | node_pool_id: Optional[str] = None, |
3369 | 3370 | name: Optional[str] = None, |
3370 | 3371 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3371 | | - timeout: Optional[float] = None, |
| 3372 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3372 | 3373 | metadata: Sequence[Tuple[str, str]] = (), |
3373 | 3374 | ) -> cluster_service.Operation: |
3374 | 3375 | r"""Rolls back a previously Aborted or Failed NodePool |
@@ -3523,7 +3524,7 @@ async def set_node_pool_management( |
3523 | 3524 | ] = None, |
3524 | 3525 | *, |
3525 | 3526 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3526 | | - timeout: Optional[float] = None, |
| 3527 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3527 | 3528 | metadata: Sequence[Tuple[str, str]] = (), |
3528 | 3529 | ) -> cluster_service.Operation: |
3529 | 3530 | r"""Sets the NodeManagement options for a node pool. |
@@ -3604,7 +3605,7 @@ async def set_labels( |
3604 | 3605 | request: Optional[Union[cluster_service.SetLabelsRequest, dict]] = None, |
3605 | 3606 | *, |
3606 | 3607 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3607 | | - timeout: Optional[float] = None, |
| 3608 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3608 | 3609 | metadata: Sequence[Tuple[str, str]] = (), |
3609 | 3610 | ) -> cluster_service.Operation: |
3610 | 3611 | r"""Sets labels on a cluster. |
@@ -3693,7 +3694,7 @@ async def set_legacy_abac( |
3693 | 3694 | enabled: Optional[bool] = None, |
3694 | 3695 | name: Optional[str] = None, |
3695 | 3696 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3696 | | - timeout: Optional[float] = None, |
| 3697 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3697 | 3698 | metadata: Sequence[Tuple[str, str]] = (), |
3698 | 3699 | ) -> cluster_service.Operation: |
3699 | 3700 | r"""Enables or disables the ABAC authorization mechanism |
@@ -3845,7 +3846,7 @@ async def start_ip_rotation( |
3845 | 3846 | cluster_id: Optional[str] = None, |
3846 | 3847 | name: Optional[str] = None, |
3847 | 3848 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3848 | | - timeout: Optional[float] = None, |
| 3849 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3849 | 3850 | metadata: Sequence[Tuple[str, str]] = (), |
3850 | 3851 | ) -> cluster_service.Operation: |
3851 | 3852 | r"""Starts master IP rotation. |
@@ -3988,7 +3989,7 @@ async def complete_ip_rotation( |
3988 | 3989 | cluster_id: Optional[str] = None, |
3989 | 3990 | name: Optional[str] = None, |
3990 | 3991 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
3991 | | - timeout: Optional[float] = None, |
| 3992 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
3992 | 3993 | metadata: Sequence[Tuple[str, str]] = (), |
3993 | 3994 | ) -> cluster_service.Operation: |
3994 | 3995 | r"""Completes master IP rotation. |
@@ -4124,7 +4125,7 @@ async def set_node_pool_size( |
4124 | 4125 | request: Optional[Union[cluster_service.SetNodePoolSizeRequest, dict]] = None, |
4125 | 4126 | *, |
4126 | 4127 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
4127 | | - timeout: Optional[float] = None, |
| 4128 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
4128 | 4129 | metadata: Sequence[Tuple[str, str]] = (), |
4129 | 4130 | ) -> cluster_service.Operation: |
4130 | 4131 | r"""Sets the size for a specific node pool. The new size will be |
@@ -4214,7 +4215,7 @@ async def set_network_policy( |
4214 | 4215 | network_policy: Optional[cluster_service.NetworkPolicy] = None, |
4215 | 4216 | name: Optional[str] = None, |
4216 | 4217 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
4217 | | - timeout: Optional[float] = None, |
| 4218 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
4218 | 4219 | metadata: Sequence[Tuple[str, str]] = (), |
4219 | 4220 | ) -> cluster_service.Operation: |
4220 | 4221 | r"""Enables or disables Network Policy for a cluster. |
@@ -4366,7 +4367,7 @@ async def set_maintenance_policy( |
4366 | 4367 | maintenance_policy: Optional[cluster_service.MaintenancePolicy] = None, |
4367 | 4368 | name: Optional[str] = None, |
4368 | 4369 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
4369 | | - timeout: Optional[float] = None, |
| 4370 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
4370 | 4371 | metadata: Sequence[Tuple[str, str]] = (), |
4371 | 4372 | ) -> cluster_service.Operation: |
4372 | 4373 | r"""Sets the maintenance policy for a cluster. |
@@ -4515,7 +4516,7 @@ async def list_usable_subnetworks( |
4515 | 4516 | ] = None, |
4516 | 4517 | *, |
4517 | 4518 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
4518 | | - timeout: Optional[float] = None, |
| 4519 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
4519 | 4520 | metadata: Sequence[Tuple[str, str]] = (), |
4520 | 4521 | ) -> pagers.ListUsableSubnetworksAsyncPager: |
4521 | 4522 | r"""Lists subnetworks that are usable for creating |
@@ -4613,14 +4614,9 @@ async def __aexit__(self, exc_type, exc, tb): |
4613 | 4614 | await self.transport.close() |
4614 | 4615 |
|
4615 | 4616 |
|
4616 | | -try: |
4617 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
4618 | | - gapic_version=pkg_resources.get_distribution( |
4619 | | - "google-cloud-container", |
4620 | | - ).version, |
4621 | | - ) |
4622 | | -except pkg_resources.DistributionNotFound: |
4623 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 4617 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 4618 | + gapic_version=package_version.__version__ |
| 4619 | +) |
4624 | 4620 |
|
4625 | 4621 |
|
4626 | 4622 | __all__ = ("ClusterManagerAsyncClient",) |
0 commit comments