From b68fcaa8db75b622b769913e4f4eb366223e8279 Mon Sep 17 00:00:00 2001 From: Cloud SDK Librarian Date: Wed, 28 Jan 2026 08:42:45 +0000 Subject: [PATCH] feat: generate libraries --- .librarian/state.yaml | 14 +- .../google/cloud/container/__init__.py | 8 + .../google/cloud/container_v1/__init__.py | 8 + .../services/cluster_manager/async_client.py | 2 + .../services/cluster_manager/client.py | 22 + .../cloud/container_v1/types/__init__.py | 8 + .../container_v1/types/cluster_service.py | 847 ++++++++++++++++- .../cloud/container_v1beta1/__init__.py | 18 + .../container_v1beta1/gapic_metadata.json | 10 + .../services/cluster_manager/async_client.py | 94 ++ .../services/cluster_manager/client.py | 114 +++ .../cluster_manager/transports/base.py | 14 + .../cluster_manager/transports/grpc.py | 32 + .../transports/grpc_asyncio.py | 38 + .../cloud/container_v1beta1/types/__init__.py | 18 + .../types/cluster_service.py | 885 +++++++++++++++++- ...er_complete_control_plane_upgrade_async.py | 51 + ...ger_complete_control_plane_upgrade_sync.py | 51 + ...pet_metadata_google.container.v1beta1.json | 153 +++ .../container_v1/test_cluster_manager.py | 58 +- .../container_v1beta1/test_cluster_manager.py | 425 ++++++++- .../cloud/documentai_v1/types/document.py | 4 +- .../documentai_v1beta3/types/document.py | 87 +- .../types/document_processor_service.py | 15 +- .../cloud/network_management/__init__.py | 4 + .../cloud/network_management_v1/__init__.py | 4 + .../async_client.py | 2 +- .../client.py | 2 +- .../transports/rest.py | 8 +- .../transports/rest_base.py | 8 +- .../reachability_service/transports/rest.py | 8 +- .../transports/rest_base.py | 8 +- .../vpc_flow_logs_service/async_client.py | 2 +- .../services/vpc_flow_logs_service/client.py | 2 +- .../vpc_flow_logs_service/transports/rest.py | 8 +- .../transports/rest_base.py | 8 +- .../network_management_v1/types/__init__.py | 4 + .../types/connectivity_test.py | 75 +- .../network_management_v1/types/trace.py | 232 ++++- .../types/vpc_flow_logs.py | 2 +- .../test_reachability_service.py | 22 + .../cloud/cloudquotas_v1/types/resources.py | 2 +- .../cloudquotas_v1beta/types/resources.py | 2 +- .../google/cloud/retail_v2beta/__init__.py | 4 + .../cloud/retail_v2beta/types/__init__.py | 4 + .../cloud/retail_v2beta/types/common.py | 30 + .../retail_v2beta/types/search_service.py | 34 +- .../grafeas/grafeas_v1/types/discovery.py | 8 + .../unit/gapic/grafeas_v1/test_grafeas.py | 2 + 49 files changed, 3253 insertions(+), 208 deletions(-) create mode 100644 packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_async.py create mode 100644 packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_sync.py diff --git a/.librarian/state.yaml b/.librarian/state.yaml index d06edcf23b71..e53bb15b65be 100644 --- a/.librarian/state.yaml +++ b/.librarian/state.yaml @@ -1069,7 +1069,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-container version: 2.62.0 - last_generated_commit: 94ccdfe4519e0ba817bd33aa22eb9c64f88a6874 + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: google/container/v1 service_config: container_v1.yaml @@ -1416,7 +1416,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-documentai version: 3.8.0 - last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: google/cloud/documentai/v1beta3 service_config: documentai_v1beta3.yaml @@ -2097,7 +2097,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-network-management version: 1.31.0 - last_generated_commit: 53f97391f3451398f7b53c7f86dabd325d205677 + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: google/cloud/networkmanagement/v1 service_config: networkmanagement_v1.yaml @@ -2387,7 +2387,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-quotas version: 0.3.0 - last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: google/api/cloudquotas/v1 service_config: cloudquotas_v1.yaml @@ -2507,7 +2507,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-retail version: 2.8.0 - last_generated_commit: 3322511885371d2b2253f209ccc3aa60d4100cfd + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: google/cloud/retail/v2 service_config: retail_v2.yaml @@ -3598,7 +3598,7 @@ libraries: tag_format: '{id}-v{version}' - id: googleapis-common-protos version: 1.72.0 - last_generated_commit: 87e3579c041a50f985f8de71e9494c8fc85d520b + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: google/api service_config: serviceconfig.yaml @@ -3625,7 +3625,7 @@ libraries: tag_format: '{id}-v{version}' - id: grafeas version: 1.18.0 - last_generated_commit: 94aa4f5ae672addf00e7970ecc47699e34989e90 + last_generated_commit: cfe62b3c5ceb9f81879c61480f26707980534462 apis: - path: grafeas/v1 service_config: grafeas_v1.yaml diff --git a/packages/google-cloud-container/google/cloud/container/__init__.py b/packages/google-cloud-container/google/cloud/container/__init__.py index 51da26b6843e..f02cfb25e879 100644 --- a/packages/google-cloud-container/google/cloud/container/__init__.py +++ b/packages/google-cloud-container/google/cloud/container/__init__.py @@ -73,6 +73,7 @@ DeleteNodePoolRequest, DesiredAdditionalIPRangesConfig, DesiredEnterpriseConfig, + DisruptionEvent, DnsCacheConfig, DNSConfig, EnterpriseConfig, @@ -99,6 +100,7 @@ GetServerConfigRequest, GkeAutoUpgradeConfig, GkeBackupAgentConfig, + GPUDirectConfig, GPUDriverInstallationConfig, GPUSharingConfig, HighScaleCheckpointingConfig, @@ -131,6 +133,7 @@ MaintenanceExclusionOptions, MaintenancePolicy, MaintenanceWindow, + ManagedOpenTelemetryConfig, ManagedPrometheusConfig, MasterAuth, MasterAuthorizedNetworksConfig, @@ -204,6 +207,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + SliceControllerConfig, SoleTenantConfig, StackType, StartIPRotationRequest, @@ -280,6 +284,7 @@ "DeleteNodePoolRequest", "DesiredAdditionalIPRangesConfig", "DesiredEnterpriseConfig", + "DisruptionEvent", "DnsCacheConfig", "DNSConfig", "EnterpriseConfig", @@ -306,6 +311,7 @@ "GetServerConfigRequest", "GkeAutoUpgradeConfig", "GkeBackupAgentConfig", + "GPUDirectConfig", "GPUDriverInstallationConfig", "GPUSharingConfig", "HighScaleCheckpointingConfig", @@ -336,6 +342,7 @@ "MaintenanceExclusionOptions", "MaintenancePolicy", "MaintenanceWindow", + "ManagedOpenTelemetryConfig", "ManagedPrometheusConfig", "MasterAuth", "MasterAuthorizedNetworksConfig", @@ -407,6 +414,7 @@ "SetNodePoolSizeRequest", "ShieldedInstanceConfig", "ShieldedNodes", + "SliceControllerConfig", "SoleTenantConfig", "StartIPRotationRequest", "StatefulHAConfig", diff --git a/packages/google-cloud-container/google/cloud/container_v1/__init__.py b/packages/google-cloud-container/google/cloud/container_v1/__init__.py index 1e85fa33fdcb..cdc49adeca87 100644 --- a/packages/google-cloud-container/google/cloud/container_v1/__init__.py +++ b/packages/google-cloud-container/google/cloud/container_v1/__init__.py @@ -78,6 +78,7 @@ DeleteNodePoolRequest, DesiredAdditionalIPRangesConfig, DesiredEnterpriseConfig, + DisruptionEvent, DnsCacheConfig, DNSConfig, EnterpriseConfig, @@ -104,6 +105,7 @@ GetServerConfigRequest, GkeAutoUpgradeConfig, GkeBackupAgentConfig, + GPUDirectConfig, GPUDriverInstallationConfig, GPUSharingConfig, HighScaleCheckpointingConfig, @@ -136,6 +138,7 @@ MaintenanceExclusionOptions, MaintenancePolicy, MaintenanceWindow, + ManagedOpenTelemetryConfig, ManagedPrometheusConfig, MasterAuth, MasterAuthorizedNetworksConfig, @@ -209,6 +212,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + SliceControllerConfig, SoleTenantConfig, StackType, StartIPRotationRequest, @@ -381,6 +385,7 @@ def _get_version(dependency_name): "DeleteNodePoolRequest", "DesiredAdditionalIPRangesConfig", "DesiredEnterpriseConfig", + "DisruptionEvent", "DnsCacheConfig", "EnterpriseConfig", "EphemeralStorageLocalSsdConfig", @@ -391,6 +396,7 @@ def _get_version(dependency_name): "FetchClusterUpgradeInfoRequest", "FetchNodePoolUpgradeInfoRequest", "Fleet", + "GPUDirectConfig", "GPUDriverInstallationConfig", "GPUSharingConfig", "GatewayAPIConfig", @@ -438,6 +444,7 @@ def _get_version(dependency_name): "MaintenanceExclusionOptions", "MaintenancePolicy", "MaintenanceWindow", + "ManagedOpenTelemetryConfig", "ManagedPrometheusConfig", "MasterAuth", "MasterAuthorizedNetworksConfig", @@ -511,6 +518,7 @@ def _get_version(dependency_name): "SetNodePoolSizeRequest", "ShieldedInstanceConfig", "ShieldedNodes", + "SliceControllerConfig", "SoleTenantConfig", "StackType", "StartIPRotationRequest", diff --git a/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/async_client.py b/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/async_client.py index 5c0a283fcdbf..8ae1d5439905 100644 --- a/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/async_client.py +++ b/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/async_client.py @@ -82,6 +82,8 @@ class ClusterManagerAsyncClient: parse_crypto_key_version_path = staticmethod( ClusterManagerClient.parse_crypto_key_version_path ) + subnetwork_path = staticmethod(ClusterManagerClient.subnetwork_path) + parse_subnetwork_path = staticmethod(ClusterManagerClient.parse_subnetwork_path) topic_path = staticmethod(ClusterManagerClient.topic_path) parse_topic_path = staticmethod(ClusterManagerClient.parse_topic_path) common_billing_account_path = staticmethod( diff --git a/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/client.py b/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/client.py index 8841a608cd9d..6a7da589f980 100644 --- a/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/client.py +++ b/packages/google-cloud-container/google/cloud/container_v1/services/cluster_manager/client.py @@ -274,6 +274,28 @@ def parse_crypto_key_version_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def subnetwork_path( + project: str, + region: str, + subnetwork: str, + ) -> str: + """Returns a fully-qualified subnetwork string.""" + return "projects/{project}/regions/{region}/subnetworks/{subnetwork}".format( + project=project, + region=region, + subnetwork=subnetwork, + ) + + @staticmethod + def parse_subnetwork_path(path: str) -> Dict[str, str]: + """Parses a subnetwork path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/regions/(?P.+?)/subnetworks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def topic_path( project: str, diff --git a/packages/google-cloud-container/google/cloud/container_v1/types/__init__.py b/packages/google-cloud-container/google/cloud/container_v1/types/__init__.py index 0dc59ed7abee..2d33ce0ccb1b 100644 --- a/packages/google-cloud-container/google/cloud/container_v1/types/__init__.py +++ b/packages/google-cloud-container/google/cloud/container_v1/types/__init__.py @@ -62,6 +62,7 @@ DeleteNodePoolRequest, DesiredAdditionalIPRangesConfig, DesiredEnterpriseConfig, + DisruptionEvent, DnsCacheConfig, DNSConfig, EnterpriseConfig, @@ -88,6 +89,7 @@ GetServerConfigRequest, GkeAutoUpgradeConfig, GkeBackupAgentConfig, + GPUDirectConfig, GPUDriverInstallationConfig, GPUSharingConfig, HighScaleCheckpointingConfig, @@ -120,6 +122,7 @@ MaintenanceExclusionOptions, MaintenancePolicy, MaintenanceWindow, + ManagedOpenTelemetryConfig, ManagedPrometheusConfig, MasterAuth, MasterAuthorizedNetworksConfig, @@ -193,6 +196,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + SliceControllerConfig, SoleTenantConfig, StackType, StartIPRotationRequest, @@ -267,6 +271,7 @@ "DeleteNodePoolRequest", "DesiredAdditionalIPRangesConfig", "DesiredEnterpriseConfig", + "DisruptionEvent", "DnsCacheConfig", "DNSConfig", "EnterpriseConfig", @@ -293,6 +298,7 @@ "GetServerConfigRequest", "GkeAutoUpgradeConfig", "GkeBackupAgentConfig", + "GPUDirectConfig", "GPUDriverInstallationConfig", "GPUSharingConfig", "HighScaleCheckpointingConfig", @@ -323,6 +329,7 @@ "MaintenanceExclusionOptions", "MaintenancePolicy", "MaintenanceWindow", + "ManagedOpenTelemetryConfig", "ManagedPrometheusConfig", "MasterAuth", "MasterAuthorizedNetworksConfig", @@ -394,6 +401,7 @@ "SetNodePoolSizeRequest", "ShieldedInstanceConfig", "ShieldedNodes", + "SliceControllerConfig", "SoleTenantConfig", "StartIPRotationRequest", "StatefulHAConfig", diff --git a/packages/google-cloud-container/google/cloud/container_v1/types/cluster_service.py b/packages/google-cloud-container/google/cloud/container_v1/types/cluster_service.py index 6ab282a8fd90..8ea6058b55f0 100644 --- a/packages/google-cloud-container/google/cloud/container_v1/types/cluster_service.py +++ b/packages/google-cloud-container/google/cloud/container_v1/types/cluster_service.py @@ -77,6 +77,7 @@ "ParallelstoreCsiDriverConfig", "HighScaleCheckpointingConfig", "LustreCsiDriverConfig", + "SliceControllerConfig", "RayOperatorConfig", "GkeBackupAgentConfig", "StatefulHAConfig", @@ -192,10 +193,12 @@ "ShieldedNodes", "VirtualNIC", "FastSocket", + "GPUDirectConfig", "NotificationConfig", "ConfidentialNodes", "UpgradeEvent", "UpgradeInfoEvent", + "DisruptionEvent", "UpgradeAvailableEvent", "SecurityBulletinEvent", "Autopilot", @@ -230,6 +233,7 @@ "NodePoolUpgradeInfo", "GkeAutoUpgradeConfig", "NetworkTierConfig", + "ManagedOpenTelemetryConfig", }, ) @@ -309,10 +313,15 @@ class NodePoolUpdateStrategy(proto.Enum): SURGE is the traditional way of upgrade a node pool. max_surge and max_unavailable determines the level of upgrade parallelism. + SHORT_LIVED (5): + SHORT_LIVED is the dedicated upgrade strategy for + QueuedProvisioning and flex start nodepools scaled up only + by enqueueing to the Dynamic Workload Scheduler (DWS). """ NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0 BLUE_GREEN = 2 SURGE = 3 + SHORT_LIVED = 5 class StackType(proto.Enum): @@ -385,18 +394,24 @@ class LinuxNodeConfig(proto.Message): net.core.rmem_default net.core.wmem_default net.core.wmem_max net.core.optmem_max net.core.somaxconn net.ipv4.tcp_rmem net.ipv4.tcp_wmem net.ipv4.tcp_tw_reuse - net.ipv4.tcp_max_orphans net.netfilter.nf_conntrack_max + net.ipv4.tcp_mtu_probing net.ipv4.tcp_max_orphans + net.ipv4.tcp_max_tw_buckets net.ipv4.tcp_syn_retries + net.ipv4.tcp_ecn net.ipv4.tcp_congestion_control + net.netfilter.nf_conntrack_max net.netfilter.nf_conntrack_buckets net.netfilter.nf_conntrack_tcp_timeout_close_wait net.netfilter.nf_conntrack_tcp_timeout_time_wait net.netfilter.nf_conntrack_tcp_timeout_established net.netfilter.nf_conntrack_acct kernel.shmmni kernel.shmmax - kernel.shmall fs.aio-max-nr fs.file-max + kernel.shmall kernel.perf_event_paranoid + kernel.sched_rt_runtime_us kernel.softlockup_panic + kernel.yama.ptrace_scope kernel.kptr_restrict + kernel.dmesg_restrict kernel.sysrq fs.aio-max-nr fs.file-max fs.inotify.max_user_instances fs.inotify.max_user_watches fs.nr_open vm.dirty_background_ratio - vm.dirty_expire_centisecs vm.dirty_ratio - vm.dirty_writeback_centisecs vm.max_map_count - vm.overcommit_memory vm.overcommit_ratio + vm.dirty_background_bytes vm.dirty_expire_centisecs + vm.dirty_ratio vm.dirty_bytes vm.dirty_writeback_centisecs + vm.max_map_count vm.overcommit_memory vm.overcommit_ratio vm.vfs_cache_pressure vm.swappiness vm.watermark_scale_factor vm.min_free_kbytes cgroup_mode (google.cloud.container_v1.types.LinuxNodeConfig.CgroupMode): @@ -425,6 +440,11 @@ class LinuxNodeConfig(proto.Message): See https://docs.kernel.org/admin-guide/mm/transhuge.html for more details. + swap_config (google.cloud.container_v1.types.LinuxNodeConfig.SwapConfig): + Optional. Enables and configures swap space + on nodes. If omitted, swap is disabled. + + This field is a member of `oneof`_ ``_swap_config``. node_kernel_module_loading (google.cloud.container_v1.types.LinuxNodeConfig.NodeKernelModuleLoading): Optional. Configuration for kernel module loading on nodes. When enabled, the node pool @@ -543,6 +563,175 @@ class HugepagesConfig(proto.Message): optional=True, ) + class SwapConfig(proto.Message): + r"""Configuration for swap memory on a node pool. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + enabled (bool): + Optional. Enables or disables swap for the + node pool. + + This field is a member of `oneof`_ ``_enabled``. + encryption_config (google.cloud.container_v1.types.LinuxNodeConfig.SwapConfig.EncryptionConfig): + Optional. If omitted, swap space is encrypted + by default. + + This field is a member of `oneof`_ ``_encryption_config``. + boot_disk_profile (google.cloud.container_v1.types.LinuxNodeConfig.SwapConfig.BootDiskProfile): + Swap on the node's boot disk. + + This field is a member of `oneof`_ ``performance_profile``. + ephemeral_local_ssd_profile (google.cloud.container_v1.types.LinuxNodeConfig.SwapConfig.EphemeralLocalSsdProfile): + Swap on the local SSD shared with pod + ephemeral storage. + + This field is a member of `oneof`_ ``performance_profile``. + dedicated_local_ssd_profile (google.cloud.container_v1.types.LinuxNodeConfig.SwapConfig.DedicatedLocalSsdProfile): + Provisions a new, separate local NVMe SSD + exclusively for swap. + + This field is a member of `oneof`_ ``performance_profile``. + """ + + class EncryptionConfig(proto.Message): + r"""Defines encryption settings for the swap space. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + disabled (bool): + Optional. If true, swap space will not be + encrypted. Defaults to false (encrypted). + + This field is a member of `oneof`_ ``_disabled``. + """ + + disabled: bool = proto.Field( + proto.BOOL, + number=1, + optional=True, + ) + + class BootDiskProfile(proto.Message): + r"""Swap on the node's boot disk. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + swap_size_gib (int): + Specifies the size of the swap space in + gibibytes (GiB). + + This field is a member of `oneof`_ ``swap_size``. + swap_size_percent (int): + Specifies the size of the swap space as a + percentage of the boot disk size. + + This field is a member of `oneof`_ ``swap_size``. + """ + + swap_size_gib: int = proto.Field( + proto.INT64, + number=1, + oneof="swap_size", + ) + swap_size_percent: int = proto.Field( + proto.INT32, + number=2, + oneof="swap_size", + ) + + class EphemeralLocalSsdProfile(proto.Message): + r"""Swap on the local SSD shared with pod ephemeral storage. + + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + swap_size_gib (int): + Specifies the size of the swap space in + gibibytes (GiB). + + This field is a member of `oneof`_ ``swap_size``. + swap_size_percent (int): + Specifies the size of the swap space as a + percentage of the ephemeral local SSD capacity. + + This field is a member of `oneof`_ ``swap_size``. + """ + + swap_size_gib: int = proto.Field( + proto.INT64, + number=1, + oneof="swap_size", + ) + swap_size_percent: int = proto.Field( + proto.INT32, + number=2, + oneof="swap_size", + ) + + class DedicatedLocalSsdProfile(proto.Message): + r"""Provisions a new, separate local NVMe SSD exclusively for + swap. + + Attributes: + disk_count (int): + The number of physical local NVMe SSD disks + to attach. + """ + + disk_count: int = proto.Field( + proto.INT64, + number=1, + ) + + enabled: bool = proto.Field( + proto.BOOL, + number=1, + optional=True, + ) + encryption_config: "LinuxNodeConfig.SwapConfig.EncryptionConfig" = proto.Field( + proto.MESSAGE, + number=2, + optional=True, + message="LinuxNodeConfig.SwapConfig.EncryptionConfig", + ) + boot_disk_profile: "LinuxNodeConfig.SwapConfig.BootDiskProfile" = proto.Field( + proto.MESSAGE, + number=3, + oneof="performance_profile", + message="LinuxNodeConfig.SwapConfig.BootDiskProfile", + ) + ephemeral_local_ssd_profile: "LinuxNodeConfig.SwapConfig.EphemeralLocalSsdProfile" = proto.Field( + proto.MESSAGE, + number=4, + oneof="performance_profile", + message="LinuxNodeConfig.SwapConfig.EphemeralLocalSsdProfile", + ) + dedicated_local_ssd_profile: "LinuxNodeConfig.SwapConfig.DedicatedLocalSsdProfile" = proto.Field( + proto.MESSAGE, + number=5, + oneof="performance_profile", + message="LinuxNodeConfig.SwapConfig.DedicatedLocalSsdProfile", + ) + class NodeKernelModuleLoading(proto.Message): r"""Configuration for kernel module loading on nodes. @@ -613,6 +802,12 @@ class Policy(proto.Enum): number=5, enum=TransparentHugepageDefrag, ) + swap_config: SwapConfig = proto.Field( + proto.MESSAGE, + number=12, + optional=True, + message=SwapConfig, + ) node_kernel_module_loading: NodeKernelModuleLoading = proto.Field( proto.MESSAGE, number=13, @@ -846,6 +1041,28 @@ class NodeKubeletConfig(proto.Message): individually instead of as a group. This field is a member of `oneof`_ ``_single_process_oom_kill``. + shutdown_grace_period_seconds (int): + Optional. shutdown_grace_period_seconds is the maximum + allowed grace period (in seconds) the total duration that + the node should delay the shutdown during a graceful + shutdown. This is the total grace period for pod termination + for both regular and critical pods. + https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/ + If set to 0, node will not enable the graceful node shutdown + functionality. This field is only valid for Spot VMs. + Allowed values: 0, 30, 120. + + This field is a member of `oneof`_ ``_shutdown_grace_period_seconds``. + shutdown_grace_period_critical_pods_seconds (int): + Optional. shutdown_grace_period_critical_pods_seconds is the + maximum allowed grace period (in seconds) used to terminate + critical pods during a node shutdown. This value should be + <= shutdown_grace_period_seconds, and is only valid if + shutdown_grace_period_seconds is set. + https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/ + Range: [0, 120]. + + This field is a member of `oneof`_ ``_shutdown_grace_period_critical_pods_seconds``. """ cpu_manager_policy: str = proto.Field( @@ -936,6 +1153,16 @@ class NodeKubeletConfig(proto.Message): number=22, optional=True, ) + shutdown_grace_period_seconds: int = proto.Field( + proto.INT32, + number=26, + optional=True, + ) + shutdown_grace_period_critical_pods_seconds: int = proto.Field( + proto.INT32, + number=27, + optional=True, + ) class TopologyManager(proto.Message): @@ -1476,6 +1703,10 @@ class NodeConfig(proto.Message): Secondary boot disk update strategy. This field is a member of `oneof`_ ``_secondary_boot_disk_update_strategy``. + gpu_direct_config (google.cloud.container_v1.types.GPUDirectConfig): + The configuration for GPU Direct + + This field is a member of `oneof`_ ``_gpu_direct_config``. max_run_duration (google.protobuf.duration_pb2.Duration): The maximum duration for the nodes to exist. If unspecified, the nodes can exist @@ -1497,6 +1728,12 @@ class NodeConfig(proto.Message): boot_disk (google.cloud.container_v1.types.BootDisk): The boot disk configuration for the node pool. + consolidation_delay (google.protobuf.duration_pb2.Duration): + Consolidation delay defines duration after + which the Cluster Autoscaler can scale down + underutilized nodes. If not set, nodes are + scaled down by default behavior, i.e. according + to the chosen autoscaling profile. """ class LocalSsdEncryptionMode(proto.Enum): @@ -1730,6 +1967,12 @@ class EffectiveCgroupMode(proto.Enum): message="SecondaryBootDiskUpdateStrategy", ) ) + gpu_direct_config: "GPUDirectConfig" = proto.Field( + proto.MESSAGE, + number=51, + optional=True, + message="GPUDirectConfig", + ) max_run_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=53, @@ -1756,6 +1999,11 @@ class EffectiveCgroupMode(proto.Enum): number=57, message="BootDisk", ) + consolidation_delay: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=60, + message=duration_pb2.Duration, + ) class AdvancedMachineFeatures(proto.Message): @@ -1911,13 +2159,20 @@ class NodeNetworkConfig(proto.Message): The ratio is Usage/[Total number of IPs in the secondary range], Usage=numNodes\ *numZones*\ podIPsPerNode. subnetwork (str): - Output only. The subnetwork path for the node - pool. Format: + Optional. The subnetwork name/path for the + node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork} If the cluster is associated with multiple - subnetworks, the subnetwork for the node pool is - picked based on the IP utilization during node - pool creation and is immutable. + subnetworks, the subnetwork can be either: + + 1. A user supplied subnetwork name/full path + during node pool creation. Example1: + my-subnet + Example2: + projects/gke-project/regions/us-central1/subnetworks/my-subnet + 2. A subnetwork path picked based on the IP + utilization during node pool creation and + is immutable. network_tier_config (google.cloud.container_v1.types.NetworkTierConfig): Output only. The network tier configuration for the node pool inherits from the @@ -2296,6 +2551,10 @@ class ContainerdConfig(proto.Message): writable_cgroups (google.cloud.container_v1.types.ContainerdConfig.WritableCgroups): Optional. WritableCgroups defines writable cgroups configuration for the node pool. + registry_hosts (MutableSequence[google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig]): + RegistryHostConfig configures containerd registry host + configuration. Each registry_hosts represents a hosts.toml + file. At most 25 registry_hosts are allowed. """ class PrivateRegistryAccessConfig(proto.Message): @@ -2326,8 +2585,7 @@ class CertificateAuthorityDomainConfig(proto.Message): - my.customdomain.com - 10.0.1.2:5000 gcp_secret_manager_certificate_config (google.cloud.container_v1.types.ContainerdConfig.PrivateRegistryAccessConfig.CertificateAuthorityDomainConfig.GCPSecretManagerCertificateConfig): - Google Secret Manager (GCP) certificate - configuration. + Secret Manager certificate configuration. This field is a member of `oneof`_ ``certificate_config``. """ @@ -2385,6 +2643,218 @@ class WritableCgroups(proto.Message): number=1, ) + class RegistryHostConfig(proto.Message): + r"""RegistryHostConfig configures the top-level structure for a + single containerd registry server's configuration, which + represents one hosts.toml file on the node. It will override the + same fqdns in PrivateRegistryAccessConfig. + + Attributes: + server (str): + Defines the host name of the registry server, + which will be used to create configuration file + as /etc/containerd/hosts.d//hosts.toml. + It supports fully qualified domain names (FQDN) + and IP addresses: + + Specifying port is supported. + Wildcards are NOT supported. + Examples: + + - my.customdomain.com + - 10.0.1.2:5000 + hosts (MutableSequence[google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.HostConfig]): + HostConfig configures a list of host-specific + configurations for the server. + Each server can have at most 10 host + configurations. + """ + + class HostCapability(proto.Enum): + r"""HostCapability configures capabilities for the registry host. + + Values: + HOST_CAPABILITY_UNSPECIFIED (0): + UNKNOWN should never be set. + HOST_CAPABILITY_PULL (1): + Pull represents the capability to fetch + manifests and blobs by digest. + HOST_CAPABILITY_RESOLVE (2): + Resolve represents the capability to fetch + manifests by name. + HOST_CAPABILITY_PUSH (3): + Push represents the capability to push blobs + and manifests. + """ + HOST_CAPABILITY_UNSPECIFIED = 0 + HOST_CAPABILITY_PULL = 1 + HOST_CAPABILITY_RESOLVE = 2 + HOST_CAPABILITY_PUSH = 3 + + class CertificateConfig(proto.Message): + r"""CertificateConfig configures certificate for the registry. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcp_secret_manager_secret_uri (str): + The URI configures a secret from `Secret + Manager `__ in the + format + "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION" + for global secret or + "projects/$PROJECT_ID/locations/$REGION/secrets/$SECRET_NAME/versions/$VERSION" + for regional secret. Version can be fixed (e.g. "2") or + "latest". + + This field is a member of `oneof`_ ``certificate``. + """ + + gcp_secret_manager_secret_uri: str = proto.Field( + proto.STRING, + number=1, + oneof="certificate", + ) + + class CertificateConfigPair(proto.Message): + r"""CertificateConfigPair configures pairs of certificates, which + is used for client certificate and key pairs under a registry. + + Attributes: + cert (google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.CertificateConfig): + Cert configures the client certificate. + key (google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.CertificateConfig): + Key configures the client private key. + Optional. + """ + + cert: "ContainerdConfig.RegistryHostConfig.CertificateConfig" = proto.Field( + proto.MESSAGE, + number=1, + message="ContainerdConfig.RegistryHostConfig.CertificateConfig", + ) + key: "ContainerdConfig.RegistryHostConfig.CertificateConfig" = proto.Field( + proto.MESSAGE, + number=2, + message="ContainerdConfig.RegistryHostConfig.CertificateConfig", + ) + + class RegistryHeader(proto.Message): + r"""RegistryHeader configures headers for the registry. + + Attributes: + key (str): + Key configures the header key. + value (MutableSequence[str]): + Value configures the header value. + """ + + key: str = proto.Field( + proto.STRING, + number=1, + ) + value: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=2, + ) + + class HostConfig(proto.Message): + r"""HostConfig configures the registry host under a given Server. + + Attributes: + host (str): + Host configures the registry host/mirror. + It supports fully qualified domain names (FQDN) + and IP addresses: + + Specifying port is supported. + Wildcards are NOT supported. + Examples: + + - my.customdomain.com + - 10.0.1.2:5000 + capabilities (MutableSequence[google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.HostCapability]): + Capabilities represent the capabilities of + the registry host, specifying what operations a + host is capable of performing. If not set, + containerd enables all capabilities by default. + override_path (bool): + OverridePath is used to indicate the host's + API root endpoint is defined in the URL path + rather than by the API specification. This may + be used with non-compliant OCI registries which + are missing the /v2 prefix. + If not set, containerd sets default false. + header (MutableSequence[google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.RegistryHeader]): + Header configures the registry host headers. + ca (MutableSequence[google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.CertificateConfig]): + CA configures the registry host certificate. + client (MutableSequence[google.cloud.container_v1.types.ContainerdConfig.RegistryHostConfig.CertificateConfigPair]): + Client configures the registry host client + certificate and key. + dial_timeout (google.protobuf.duration_pb2.Duration): + Specifies the maximum duration allowed for a connection + attempt to complete. A shorter timeout helps reduce delays + when falling back to the original registry if the mirror is + unreachable. Maximum allowed value is 180s. If not set, + containerd sets default 30s. The value should be a decimal + number of seconds with an ``s`` suffix. + """ + + host: str = proto.Field( + proto.STRING, + number=1, + ) + capabilities: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.HostCapability" + ] = proto.RepeatedField( + proto.ENUM, + number=2, + enum="ContainerdConfig.RegistryHostConfig.HostCapability", + ) + override_path: bool = proto.Field( + proto.BOOL, + number=3, + ) + header: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.RegistryHeader" + ] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message="ContainerdConfig.RegistryHostConfig.RegistryHeader", + ) + ca: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.CertificateConfig" + ] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message="ContainerdConfig.RegistryHostConfig.CertificateConfig", + ) + client: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.CertificateConfigPair" + ] = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="ContainerdConfig.RegistryHostConfig.CertificateConfigPair", + ) + dial_timeout: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=7, + message=duration_pb2.Duration, + ) + + server: str = proto.Field( + proto.STRING, + number=1, + ) + hosts: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.HostConfig" + ] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="ContainerdConfig.RegistryHostConfig.HostConfig", + ) + private_registry_access_config: PrivateRegistryAccessConfig = proto.Field( proto.MESSAGE, number=1, @@ -2395,6 +2865,11 @@ class WritableCgroups(proto.Message): number=2, message=WritableCgroups, ) + registry_hosts: MutableSequence[RegistryHostConfig] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message=RegistryHostConfig, + ) class NodeTaint(proto.Message): @@ -2670,6 +3145,9 @@ class AddonsConfig(proto.Message): Checkpointing add-on. lustre_csi_driver_config (google.cloud.container_v1.types.LustreCsiDriverConfig): Configuration for the Lustre CSI driver. + slice_controller_config (google.cloud.container_v1.types.SliceControllerConfig): + Optional. Configuration for the slice + controller add-on. """ http_load_balancing: "HttpLoadBalancing" = proto.Field( @@ -2754,6 +3232,11 @@ class AddonsConfig(proto.Message): number=23, message="LustreCsiDriverConfig", ) + slice_controller_config: "SliceControllerConfig" = proto.Field( + proto.MESSAGE, + number=26, + message="SliceControllerConfig", + ) class HttpLoadBalancing(proto.Message): @@ -3137,6 +3620,21 @@ class LustreCsiDriverConfig(proto.Message): ) +class SliceControllerConfig(proto.Message): + r"""Configuration for the Slice Controller. + + Attributes: + enabled (bool): + Optional. Indicates whether Slice Controller + is enabled in the cluster. + """ + + enabled: bool = proto.Field( + proto.BOOL, + number=1, + ) + + class RayOperatorConfig(proto.Message): r"""Configuration options for the Ray Operator add-on. @@ -3440,7 +3938,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3455,7 +3953,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3473,7 +3971,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3491,7 +3989,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3745,7 +4243,7 @@ class Cluster(proto.Message): cluster_ipv4_cidr (str): The IP address range of the container pods in this cluster, in - `CIDR `__ + `CIDR `__ 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``. @@ -3931,7 +4429,7 @@ class Cluster(proto.Message): services_ipv4_cidr (str): Output only. The IP address range of the Kubernetes services in this cluster, in - `CIDR `__ + `CIDR `__ notation (e.g. ``1.2.3.4/29``). Service addresses are typically put in the last ``/16`` from the container CIDR. instance_group_urls (MutableSequence[str]): @@ -3959,7 +4457,7 @@ class Cluster(proto.Message): tpu_ipv4_cidr_block (str): Output only. The IP address range of the Cloud TPUs in this cluster, in - `CIDR `__ + `CIDR `__ notation (e.g. ``1.2.3.4/29``). This field is deprecated due to the deprecation of 2VM TPU. The end of life date for 2VM TPU is 2025-04-25. @@ -4036,6 +4534,9 @@ class Cluster(proto.Message): anonymous_authentication_config (google.cloud.container_v1.types.AnonymousAuthenticationConfig): Configuration for limiting anonymous access to all endpoints except the health checks. + managed_opentelemetry_config (google.cloud.container_v1.types.ManagedOpenTelemetryConfig): + Configuration for Managed OpenTelemetry + pipeline. """ class Status(proto.Enum): @@ -4438,6 +4939,11 @@ class Status(proto.Enum): number=164, message="AnonymousAuthenticationConfig", ) + managed_opentelemetry_config: "ManagedOpenTelemetryConfig" = proto.Field( + proto.MESSAGE, + number=168, + message="ManagedOpenTelemetryConfig", + ) class RBACBindingConfig(proto.Message): @@ -4510,6 +5016,10 @@ class UserManagedKeysConfig(proto.Message): The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control plane nodes. + control_plane_disk_encryption_key_versions (MutableSequence[str]): + Output only. All of the versions of the Cloud + KMS cryptoKey that are used by Confidential + Hyperdisks on the control plane nodes. gkeops_etcd_backup_encryption_key (str): Resource path of the Cloud KMS cryptoKey to use for encryption of internal etcd backups. @@ -4543,6 +5053,12 @@ class UserManagedKeysConfig(proto.Message): proto.STRING, number=16, ) + control_plane_disk_encryption_key_versions: MutableSequence[ + str + ] = proto.RepeatedField( + proto.STRING, + number=18, + ) gkeops_etcd_backup_encryption_key: str = proto.Field( proto.STRING, number=17, @@ -5179,6 +5695,12 @@ class ClusterUpdate(proto.Message): desired_network_tier_config (google.cloud.container_v1.types.NetworkTierConfig): The desired network tier configuration for the cluster. + desired_privileged_admission_config (google.cloud.container_v1.types.PrivilegedAdmissionConfig): + The desired privileged admission config for + the cluster. + desired_managed_opentelemetry_config (google.cloud.container_v1.types.ManagedOpenTelemetryConfig): + The desired managed open telemetry + configuration. """ desired_node_version: str = proto.Field( @@ -5545,6 +6067,16 @@ class ClusterUpdate(proto.Message): number=155, message="NetworkTierConfig", ) + desired_privileged_admission_config: "PrivilegedAdmissionConfig" = proto.Field( + proto.MESSAGE, + number=159, + message="PrivilegedAdmissionConfig", + ) + desired_managed_opentelemetry_config: "ManagedOpenTelemetryConfig" = proto.Field( + proto.MESSAGE, + number=163, + message="ManagedOpenTelemetryConfig", + ) class AdditionalPodRangesConfig(proto.Message): @@ -5587,8 +6119,32 @@ class AdditionalIPRangesConfig(proto.Message): subnetwork that can be used for pod IPs. Example1: gke-pod-range1 Example2: gke-pod-range1,gke-pod-range2 + status (google.cloud.container_v1.types.AdditionalIPRangesConfig.Status): + Draining status of the additional subnet. """ + class Status(proto.Enum): + r"""Additional subnet with DRAINING status will not be selected during + new node pool creation. To undrain the draining status, update the + cluster to set the sunbet to ACTIVE status. To remove the additional + subnet, use the update cluster API to remove the subnet from the + desired_additional_ip_ranges list. IP ranges can be removed + regardless of its status, as long as no node pools are using them. + + Values: + STATUS_UNSPECIFIED (0): + Not set, same as ACTIVE. + ACTIVE (1): + ACTIVE status indicates that the subnet is + available for new node pool creation. + DRAINING (2): + DRAINING status indicates that the subnet is + not used for new node pool creation. + """ + STATUS_UNSPECIFIED = 0 + ACTIVE = 1 + DRAINING = 2 + subnetwork: str = proto.Field( proto.STRING, number=1, @@ -5597,6 +6153,11 @@ class AdditionalIPRangesConfig(proto.Message): proto.STRING, number=2, ) + status: Status = proto.Field( + proto.ENUM, + number=3, + enum=Status, + ) class DesiredAdditionalIPRangesConfig(proto.Message): @@ -6387,6 +6948,15 @@ class UpdateNodePoolRequest(proto.Message): node pool. Initiates an upgrade operation that migrates the nodes in the node pool to the specified boot disk config. + node_drain_config (google.cloud.container_v1.types.NodePool.NodeDrainConfig): + The desired node drain configuration for + nodes in the node pool. + consolidation_delay (google.protobuf.duration_pb2.Duration): + Consolidation delay defines duration after + which the Cluster Autoscaler can scale down + underutilized nodes. If not set, nodes are + scaled down by default behavior, i.e. according + to the chosen autoscaling profile. """ project_id: str = proto.Field( @@ -6551,6 +7121,16 @@ class UpdateNodePoolRequest(proto.Message): number=47, message="BootDisk", ) + node_drain_config: "NodePool.NodeDrainConfig" = proto.Field( + proto.MESSAGE, + number=48, + message="NodePool.NodeDrainConfig", + ) + consolidation_delay: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=49, + message=duration_pb2.Duration, + ) class SetNodePoolAutoscalingRequest(proto.Message): @@ -7750,6 +8330,9 @@ class NodePool(proto.Message): provisioning. best_effort_provisioning (google.cloud.container_v1.types.BestEffortProvisioning): Enable best effort provisioning for nodes + node_drain_config (google.cloud.container_v1.types.NodePool.NodeDrainConfig): + Specifies the node drain configuration for + this node pool. """ class Status(proto.Enum): @@ -8043,6 +8626,27 @@ class QueuedProvisioning(proto.Message): number=1, ) + class NodeDrainConfig(proto.Message): + r"""NodeDrainConfig contains the node drain related + configurations for this nodepool. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + respect_pdb_during_node_pool_deletion (bool): + Whether to respect PDB during node pool + deletion. + + This field is a member of `oneof`_ ``_respect_pdb_during_node_pool_deletion``. + """ + + respect_pdb_during_node_pool_deletion: bool = proto.Field( + proto.BOOL, + number=3, + optional=True, + ) + name: str = proto.Field( proto.STRING, number=1, @@ -8139,6 +8743,11 @@ class QueuedProvisioning(proto.Message): number=113, message="BestEffortProvisioning", ) + node_drain_config: NodeDrainConfig = proto.Field( + proto.MESSAGE, + number=116, + message=NodeDrainConfig, + ) class NodeManagement(proto.Message): @@ -8418,7 +9027,7 @@ class RecurringTimeWindow(proto.Message): recurrence (str): An RRULE (https://tools.ietf.org/html/rfc5545#section-3.8.5.3) for - how this window reccurs. They go on for the span of time + how this window recurs. They go on for the span of time between the start and end time. For example, to have something repeat every weekday, you'd @@ -8729,6 +9338,9 @@ class ClusterAutoscaling(proto.Message): default_compute_class_config (google.cloud.container_v1.types.DefaultComputeClassConfig): Default compute class is a configuration for default compute class. + autopilot_general_profile (google.cloud.container_v1.types.ClusterAutoscaling.AutopilotGeneralProfile): + Autopilot general profile for the cluster, + which defines the configuration for the cluster. """ class AutoscalingProfile(proto.Enum): @@ -8748,6 +9360,18 @@ class AutoscalingProfile(proto.Enum): OPTIMIZE_UTILIZATION = 1 BALANCED = 2 + class AutopilotGeneralProfile(proto.Enum): + r"""Defines possible options for Autopilot general profile. + + Values: + AUTOPILOT_GENERAL_PROFILE_UNSPECIFIED (0): + Use default configuration. + NO_PERFORMANCE (1): + Avoid extra IP consumption. + """ + AUTOPILOT_GENERAL_PROFILE_UNSPECIFIED = 0 + NO_PERFORMANCE = 1 + enable_node_autoprovisioning: bool = proto.Field( proto.BOOL, number=1, @@ -8778,6 +9402,11 @@ class AutoscalingProfile(proto.Enum): number=9, message="DefaultComputeClassConfig", ) + autopilot_general_profile: AutopilotGeneralProfile = proto.Field( + proto.ENUM, + number=14, + enum=AutopilotGeneralProfile, + ) class AutoprovisioningNodePoolDefaults(proto.Message): @@ -10833,6 +11462,43 @@ class FastSocket(proto.Message): ) +class GPUDirectConfig(proto.Message): + r"""GPUDirectConfig specifies the GPU direct strategy on the node + pool. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gpu_direct_strategy (google.cloud.container_v1.types.GPUDirectConfig.GPUDirectStrategy): + The type of GPU direct strategy to enable on + the node pool. + + This field is a member of `oneof`_ ``_gpu_direct_strategy``. + """ + + class GPUDirectStrategy(proto.Enum): + r"""Option for GPU direct Strategies + + Values: + GPU_DIRECT_STRATEGY_UNSPECIFIED (0): + Default value. No GPU Direct strategy is + enabled on the node. + RDMA (2): + GPUDirect-RDMA on A3 Ultra, and A4 machine + types + """ + GPU_DIRECT_STRATEGY_UNSPECIFIED = 0 + RDMA = 2 + + gpu_direct_strategy: GPUDirectStrategy = proto.Field( + proto.ENUM, + number=1, + optional=True, + enum=GPUDirectStrategy, + ) + + class NotificationConfig(proto.Message): r"""NotificationConfig is the configuration of notifications. @@ -11052,6 +11718,11 @@ class UpgradeInfoEvent(proto.Message): A brief description of the event. event_type (google.cloud.container_v1.types.UpgradeInfoEvent.EventType): The type of the event. + disruption_event (google.cloud.container_v1.types.DisruptionEvent): + The information about the disruption event. This field is + only populated when event_type is DISRUPTION_EVENT. + + This field is a member of `oneof`_ ``_disruption_event``. """ class State(proto.Enum): @@ -11094,11 +11765,15 @@ class EventType(proto.Enum): UPGRADE_LIFECYCLE (3): UPGRADE_LIFECYCLE indicates the event is about the upgrade lifecycle. + DISRUPTION_EVENT (4): + DISRUPTION_EVENT indicates the event is about the + disruption. """ EVENT_TYPE_UNSPECIFIED = 0 END_OF_SUPPORT = 1 COS_MILESTONE_VERSION_UPDATE = 2 UPGRADE_LIFECYCLE = 3 + DISRUPTION_EVENT = 4 resource_type: "UpgradeResourceType" = proto.Field( proto.ENUM, @@ -11157,6 +11832,98 @@ class EventType(proto.Enum): number=12, enum=EventType, ) + disruption_event: "DisruptionEvent" = proto.Field( + proto.MESSAGE, + number=14, + optional=True, + message="DisruptionEvent", + ) + + +class DisruptionEvent(proto.Message): + r"""DisruptionEvent is a notification sent to customers about the + disruption event of a resource. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + disruption_type (google.cloud.container_v1.types.DisruptionEvent.DisruptionType): + The type of the disruption event. + pdb_blocked_node (str): + The node whose drain is blocked by PDB. This field is set + for both POD_PDB_VIOLATION and POD_NOT_ENOUGH_PDB event. + pdb_blocked_pod (MutableSequence[google.cloud.container_v1.types.DisruptionEvent.PdbBlockedPod]): + The pods whose evictions are blocked by PDB. This field is + set for both POD_PDB_VIOLATION and POD_NOT_ENOUGH_PDB event. + pdb_violation_timeout (google.protobuf.duration_pb2.Duration): + The timeout in seconds for which the node drain is blocked + by PDB. After this timeout, pods are forcefully evicted. + This field is only populated when event_type is + POD_PDB_VIOLATION. + + This field is a member of `oneof`_ ``_pdb_violation_timeout``. + """ + + class DisruptionType(proto.Enum): + r"""The type of the disruption event. + + Values: + DISRUPTION_TYPE_UNSPECIFIED (0): + DISRUPTION_TYPE_UNSPECIFIED indicates the disruption type is + unspecified. + POD_NOT_ENOUGH_PDB (1): + POD_NOT_ENOUGH_PDB indicates there are still running pods on + the node during node drain because their evictions are + blocked by PDB. + POD_PDB_VIOLATION (2): + POD_PDB_VIOLATION indicates that there are force pod + evictions during node drain which violate the PDB. + """ + DISRUPTION_TYPE_UNSPECIFIED = 0 + POD_NOT_ENOUGH_PDB = 1 + POD_PDB_VIOLATION = 2 + + class PdbBlockedPod(proto.Message): + r"""The namespace/name of the pod whose eviction is blocked by + PDB. + + Attributes: + namespace (str): + The namespace of the pod. + name (str): + The name of the pod. + """ + + namespace: str = proto.Field( + proto.STRING, + number=1, + ) + name: str = proto.Field( + proto.STRING, + number=2, + ) + + disruption_type: DisruptionType = proto.Field( + proto.ENUM, + number=1, + enum=DisruptionType, + ) + pdb_blocked_node: str = proto.Field( + proto.STRING, + number=2, + ) + pdb_blocked_pod: MutableSequence[PdbBlockedPod] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message=PdbBlockedPod, + ) + pdb_violation_timeout: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=4, + optional=True, + message=duration_pb2.Duration, + ) class UpgradeAvailableEvent(proto.Message): @@ -12735,4 +13502,44 @@ class NetworkTier(proto.Enum): ) +class ManagedOpenTelemetryConfig(proto.Message): + r"""ManagedOpenTelemetryConfig is the configuration for the GKE + Managed OpenTelemetry pipeline. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + scope (google.cloud.container_v1.types.ManagedOpenTelemetryConfig.Scope): + Scope of the Managed OpenTelemetry pipeline. + + This field is a member of `oneof`_ ``_scope``. + """ + + class Scope(proto.Enum): + r"""Scope is the scope of the Managed OpenTelemetry pipeline. + + Values: + SCOPE_UNSPECIFIED (0): + SCOPE_UNSPECIFIED is when the scope is not set. + NONE (1): + NONE is used to disable the Managed + OpenTelemetry pipeline. + COLLECTION_AND_INSTRUMENTATION_COMPONENTS (2): + COLLECTION_AND_INSTRUMENTATION_COMPONENTS is used to enable + the Managed OpenTelemetry pipeline for collection and + instrumentation components. + """ + SCOPE_UNSPECIFIED = 0 + NONE = 1 + COLLECTION_AND_INSTRUMENTATION_COMPONENTS = 2 + + scope: Scope = proto.Field( + proto.ENUM, + number=1, + optional=True, + enum=Scope, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/__init__.py b/packages/google-cloud-container/google/cloud/container_v1beta1/__init__.py index 35c751d09127..ff75a09f8565 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/__init__.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/__init__.py @@ -61,6 +61,8 @@ ClusterTelemetry, ClusterUpdate, ClusterUpgradeInfo, + CompatibilityStatus, + CompleteControlPlaneUpgradeRequest, CompleteIPRotationRequest, CompleteNodePoolUpgradeRequest, CompliancePostureConfig, @@ -80,6 +82,7 @@ DeleteNodePoolRequest, DesiredAdditionalIPRangesConfig, DesiredEnterpriseConfig, + DisruptionEvent, DnsCacheConfig, DNSConfig, EnterpriseConfig, @@ -107,6 +110,7 @@ GetServerConfigRequest, GkeAutoUpgradeConfig, GkeBackupAgentConfig, + GPUDirectConfig, GPUDriverInstallationConfig, GPUSharingConfig, HighScaleCheckpointingConfig, @@ -144,6 +148,7 @@ MaintenanceExclusionOptions, MaintenancePolicy, MaintenanceWindow, + ManagedOpenTelemetryConfig, ManagedPrometheusConfig, Master, MasterAuth, @@ -180,6 +185,7 @@ PodAutoscaling, PodCIDROverprovisionConfig, PodSecurityPolicyConfig, + PodSnapshotConfig, PrivateClusterConfig, PrivateClusterMasterGlobalAccessConfig, PrivateIPv6GoogleAccess, @@ -198,6 +204,8 @@ ResourceManagerTags, ResourceUsageExportConfig, RollbackNodePoolUpgradeRequest, + RollbackSafeUpgrade, + RollbackSafeUpgradeStatus, SandboxConfig, SecondaryBootDisk, SecondaryBootDiskUpdateStrategy, @@ -221,6 +229,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + SliceControllerConfig, SoleTenantConfig, StackType, StartIPRotationRequest, @@ -380,6 +389,8 @@ def _get_version(dependency_name): "ClusterTelemetry", "ClusterUpdate", "ClusterUpgradeInfo", + "CompatibilityStatus", + "CompleteControlPlaneUpgradeRequest", "CompleteIPRotationRequest", "CompleteNodePoolUpgradeRequest", "CompliancePostureConfig", @@ -400,6 +411,7 @@ def _get_version(dependency_name): "DeleteNodePoolRequest", "DesiredAdditionalIPRangesConfig", "DesiredEnterpriseConfig", + "DisruptionEvent", "DnsCacheConfig", "EnterpriseConfig", "EphemeralStorageConfig", @@ -411,6 +423,7 @@ def _get_version(dependency_name): "FetchClusterUpgradeInfoRequest", "FetchNodePoolUpgradeInfoRequest", "Fleet", + "GPUDirectConfig", "GPUDriverInstallationConfig", "GPUSharingConfig", "GatewayAPIConfig", @@ -463,6 +476,7 @@ def _get_version(dependency_name): "MaintenanceExclusionOptions", "MaintenancePolicy", "MaintenanceWindow", + "ManagedOpenTelemetryConfig", "ManagedPrometheusConfig", "Master", "MasterAuth", @@ -499,6 +513,7 @@ def _get_version(dependency_name): "PodAutoscaling", "PodCIDROverprovisionConfig", "PodSecurityPolicyConfig", + "PodSnapshotConfig", "PrivateClusterConfig", "PrivateClusterMasterGlobalAccessConfig", "PrivateIPv6GoogleAccess", @@ -517,6 +532,8 @@ def _get_version(dependency_name): "ResourceManagerTags", "ResourceUsageExportConfig", "RollbackNodePoolUpgradeRequest", + "RollbackSafeUpgrade", + "RollbackSafeUpgradeStatus", "SandboxConfig", "SecondaryBootDisk", "SecondaryBootDiskUpdateStrategy", @@ -540,6 +557,7 @@ def _get_version(dependency_name): "SetNodePoolSizeRequest", "ShieldedInstanceConfig", "ShieldedNodes", + "SliceControllerConfig", "SoleTenantConfig", "StackType", "StartIPRotationRequest", diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/gapic_metadata.json b/packages/google-cloud-container/google/cloud/container_v1beta1/gapic_metadata.json index 0b8928eea462..bed8dae47c74 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/gapic_metadata.json +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/gapic_metadata.json @@ -20,6 +20,11 @@ "check_autopilot_compatibility" ] }, + "CompleteControlPlaneUpgrade": { + "methods": [ + "complete_control_plane_upgrade" + ] + }, "CompleteIPRotation": { "methods": [ "complete_ip_rotation" @@ -210,6 +215,11 @@ "check_autopilot_compatibility" ] }, + "CompleteControlPlaneUpgrade": { + "methods": [ + "complete_control_plane_upgrade" + ] + }, "CompleteIPRotation": { "methods": [ "complete_ip_rotation" diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/async_client.py b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/async_client.py index ced3540b87c4..b4d2690fde21 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/async_client.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/async_client.py @@ -82,6 +82,8 @@ class ClusterManagerAsyncClient: parse_crypto_key_version_path = staticmethod( ClusterManagerClient.parse_crypto_key_version_path ) + subnetwork_path = staticmethod(ClusterManagerClient.subnetwork_path) + parse_subnetwork_path = staticmethod(ClusterManagerClient.parse_subnetwork_path) topic_path = staticmethod(ClusterManagerClient.topic_path) parse_topic_path = staticmethod(ClusterManagerClient.parse_topic_path) common_billing_account_path = staticmethod( @@ -5235,6 +5237,98 @@ async def sample_fetch_node_pool_upgrade_info(): # Done; return the response. return response + async def complete_control_plane_upgrade( + self, + request: Optional[ + Union[cluster_service.CompleteControlPlaneUpgradeRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> cluster_service.Operation: + r"""CompleteControlPlaneUpgrade completes the + rollback-safe upgrade by performing the step two upgrade + for a specific cluster. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import container_v1beta1 + + async def sample_complete_control_plane_upgrade(): + # Create a client + client = container_v1beta1.ClusterManagerAsyncClient() + + # Initialize request argument(s) + request = container_v1beta1.CompleteControlPlaneUpgradeRequest( + ) + + # Make the request + response = await client.complete_control_plane_upgrade(request=request) + + # Handle the response + print(response) + + Args: + request (Optional[Union[google.cloud.container_v1beta1.types.CompleteControlPlaneUpgradeRequest, dict]]): + The request object. CompleteControlPlaneUpgradeRequest + sets the name of target cluster to + complete upgrade. + retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.container_v1beta1.types.Operation: + This operation resource represents + operations that may have happened or are + happening on the cluster. All fields are + output only. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, cluster_service.CompleteControlPlaneUpgradeRequest): + request = cluster_service.CompleteControlPlaneUpgradeRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._client._transport._wrapped_methods[ + self._client._transport.complete_control_plane_upgrade + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._client._validate_universe_domain() + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def __aenter__(self) -> "ClusterManagerAsyncClient": return self diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/client.py b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/client.py index b7e703d5a55c..a76002f7c4b9 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/client.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/client.py @@ -272,6 +272,28 @@ def parse_crypto_key_version_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def subnetwork_path( + project: str, + region: str, + subnetwork: str, + ) -> str: + """Returns a fully-qualified subnetwork string.""" + return "projects/{project}/regions/{region}/subnetworks/{subnetwork}".format( + project=project, + region=region, + subnetwork=subnetwork, + ) + + @staticmethod + def parse_subnetwork_path(path: str) -> Dict[str, str]: + """Parses a subnetwork path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/regions/(?P.+?)/subnetworks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def topic_path( project: str, @@ -5617,6 +5639,98 @@ def sample_fetch_node_pool_upgrade_info(): # Done; return the response. return response + def complete_control_plane_upgrade( + self, + request: Optional[ + Union[cluster_service.CompleteControlPlaneUpgradeRequest, dict] + ] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> cluster_service.Operation: + r"""CompleteControlPlaneUpgrade completes the + rollback-safe upgrade by performing the step two upgrade + for a specific cluster. + + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud import container_v1beta1 + + def sample_complete_control_plane_upgrade(): + # Create a client + client = container_v1beta1.ClusterManagerClient() + + # Initialize request argument(s) + request = container_v1beta1.CompleteControlPlaneUpgradeRequest( + ) + + # Make the request + response = client.complete_control_plane_upgrade(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.container_v1beta1.types.CompleteControlPlaneUpgradeRequest, dict]): + The request object. CompleteControlPlaneUpgradeRequest + sets the name of target cluster to + complete upgrade. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.container_v1beta1.types.Operation: + This operation resource represents + operations that may have happened or are + happening on the cluster. All fields are + output only. + + """ + # Create or coerce a protobuf request object. + # - Use the request object if provided (there's no risk of modifying the input as + # there are no flattened fields), or create one. + if not isinstance(request, cluster_service.CompleteControlPlaneUpgradeRequest): + request = cluster_service.CompleteControlPlaneUpgradeRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[ + self._transport.complete_control_plane_upgrade + ] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), + ) + + # Validate the universe domain. + self._validate_universe_domain() + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def __enter__(self) -> "ClusterManagerClient": return self diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py index 0abd62ad0592..96315e0b44d1 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/base.py @@ -432,6 +432,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.complete_control_plane_upgrade: gapic_v1.method.wrap_method( + self.complete_control_plane_upgrade, + default_timeout=None, + client_info=client_info, + ), } def close(self): @@ -803,6 +808,15 @@ def fetch_node_pool_upgrade_info( ]: raise NotImplementedError() + @property + def complete_control_plane_upgrade( + self, + ) -> Callable[ + [cluster_service.CompleteControlPlaneUpgradeRequest], + Union[cluster_service.Operation, Awaitable[cluster_service.Operation]], + ]: + raise NotImplementedError() + @property def kind(self) -> str: raise NotImplementedError() diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py index b4311d8806b9..804dd89b2df0 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc.py @@ -1374,6 +1374,38 @@ def fetch_node_pool_upgrade_info( ) return self._stubs["fetch_node_pool_upgrade_info"] + @property + def complete_control_plane_upgrade( + self, + ) -> Callable[ + [cluster_service.CompleteControlPlaneUpgradeRequest], cluster_service.Operation + ]: + r"""Return a callable for the complete control plane upgrade method over gRPC. + + CompleteControlPlaneUpgrade completes the + rollback-safe upgrade by performing the step two upgrade + for a specific cluster. + + Returns: + Callable[[~.CompleteControlPlaneUpgradeRequest], + ~.Operation]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "complete_control_plane_upgrade" not in self._stubs: + self._stubs[ + "complete_control_plane_upgrade" + ] = self._logged_channel.unary_unary( + "/google.container.v1beta1.ClusterManager/CompleteControlPlaneUpgrade", + request_serializer=cluster_service.CompleteControlPlaneUpgradeRequest.serialize, + response_deserializer=cluster_service.Operation.deserialize, + ) + return self._stubs["complete_control_plane_upgrade"] + def close(self): self._logged_channel.close() diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py index 663076672195..419ac8289290 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/services/cluster_manager/transports/grpc_asyncio.py @@ -1432,6 +1432,39 @@ def fetch_node_pool_upgrade_info( ) return self._stubs["fetch_node_pool_upgrade_info"] + @property + def complete_control_plane_upgrade( + self, + ) -> Callable[ + [cluster_service.CompleteControlPlaneUpgradeRequest], + Awaitable[cluster_service.Operation], + ]: + r"""Return a callable for the complete control plane upgrade method over gRPC. + + CompleteControlPlaneUpgrade completes the + rollback-safe upgrade by performing the step two upgrade + for a specific cluster. + + Returns: + Callable[[~.CompleteControlPlaneUpgradeRequest], + Awaitable[~.Operation]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "complete_control_plane_upgrade" not in self._stubs: + self._stubs[ + "complete_control_plane_upgrade" + ] = self._logged_channel.unary_unary( + "/google.container.v1beta1.ClusterManager/CompleteControlPlaneUpgrade", + request_serializer=cluster_service.CompleteControlPlaneUpgradeRequest.serialize, + response_deserializer=cluster_service.Operation.deserialize, + ) + return self._stubs["complete_control_plane_upgrade"] + def _prep_wrapped_messages(self, client_info): """Precompute the wrapped methods, overriding the base class method to use async wrappers.""" self._wrapped_methods = { @@ -1730,6 +1763,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.complete_control_plane_upgrade: self._wrap_method( + self.complete_control_plane_upgrade, + default_timeout=None, + client_info=client_info, + ), } def _wrap_method(self, func, *args, **kwargs): diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/types/__init__.py b/packages/google-cloud-container/google/cloud/container_v1beta1/types/__init__.py index c72fc9e61137..8426fbcd0536 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/types/__init__.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/types/__init__.py @@ -45,6 +45,8 @@ ClusterTelemetry, ClusterUpdate, ClusterUpgradeInfo, + CompatibilityStatus, + CompleteControlPlaneUpgradeRequest, CompleteIPRotationRequest, CompleteNodePoolUpgradeRequest, CompliancePostureConfig, @@ -64,6 +66,7 @@ DeleteNodePoolRequest, DesiredAdditionalIPRangesConfig, DesiredEnterpriseConfig, + DisruptionEvent, DnsCacheConfig, DNSConfig, EnterpriseConfig, @@ -91,6 +94,7 @@ GetServerConfigRequest, GkeAutoUpgradeConfig, GkeBackupAgentConfig, + GPUDirectConfig, GPUDriverInstallationConfig, GPUSharingConfig, HighScaleCheckpointingConfig, @@ -128,6 +132,7 @@ MaintenanceExclusionOptions, MaintenancePolicy, MaintenanceWindow, + ManagedOpenTelemetryConfig, ManagedPrometheusConfig, Master, MasterAuth, @@ -164,6 +169,7 @@ PodAutoscaling, PodCIDROverprovisionConfig, PodSecurityPolicyConfig, + PodSnapshotConfig, PrivateClusterConfig, PrivateClusterMasterGlobalAccessConfig, PrivateIPv6GoogleAccess, @@ -182,6 +188,8 @@ ResourceManagerTags, ResourceUsageExportConfig, RollbackNodePoolUpgradeRequest, + RollbackSafeUpgrade, + RollbackSafeUpgradeStatus, SandboxConfig, SecondaryBootDisk, SecondaryBootDiskUpdateStrategy, @@ -205,6 +213,7 @@ SetNodePoolSizeRequest, ShieldedInstanceConfig, ShieldedNodes, + SliceControllerConfig, SoleTenantConfig, StackType, StartIPRotationRequest, @@ -268,6 +277,8 @@ "ClusterTelemetry", "ClusterUpdate", "ClusterUpgradeInfo", + "CompatibilityStatus", + "CompleteControlPlaneUpgradeRequest", "CompleteIPRotationRequest", "CompleteNodePoolUpgradeRequest", "CompliancePostureConfig", @@ -286,6 +297,7 @@ "DeleteNodePoolRequest", "DesiredAdditionalIPRangesConfig", "DesiredEnterpriseConfig", + "DisruptionEvent", "DnsCacheConfig", "DNSConfig", "EnterpriseConfig", @@ -313,6 +325,7 @@ "GetServerConfigRequest", "GkeAutoUpgradeConfig", "GkeBackupAgentConfig", + "GPUDirectConfig", "GPUDriverInstallationConfig", "GPUSharingConfig", "HighScaleCheckpointingConfig", @@ -349,6 +362,7 @@ "MaintenanceExclusionOptions", "MaintenancePolicy", "MaintenanceWindow", + "ManagedOpenTelemetryConfig", "ManagedPrometheusConfig", "Master", "MasterAuth", @@ -384,6 +398,7 @@ "PodAutoscaling", "PodCIDROverprovisionConfig", "PodSecurityPolicyConfig", + "PodSnapshotConfig", "PrivateClusterConfig", "PrivateClusterMasterGlobalAccessConfig", "PrivilegedAdmissionConfig", @@ -401,6 +416,8 @@ "ResourceManagerTags", "ResourceUsageExportConfig", "RollbackNodePoolUpgradeRequest", + "RollbackSafeUpgrade", + "RollbackSafeUpgradeStatus", "SandboxConfig", "SecondaryBootDisk", "SecondaryBootDiskUpdateStrategy", @@ -424,6 +441,7 @@ "SetNodePoolSizeRequest", "ShieldedInstanceConfig", "ShieldedNodes", + "SliceControllerConfig", "SoleTenantConfig", "StartIPRotationRequest", "StatefulHAConfig", diff --git a/packages/google-cloud-container/google/cloud/container_v1beta1/types/cluster_service.py b/packages/google-cloud-container/google/cloud/container_v1beta1/types/cluster_service.py index 0682acd6d94b..dec0107aad97 100644 --- a/packages/google-cloud-container/google/cloud/container_v1beta1/types/cluster_service.py +++ b/packages/google-cloud-container/google/cloud/container_v1beta1/types/cluster_service.py @@ -34,6 +34,7 @@ "DatapathProvider", "StackType", "InTransitEncryptionConfig", + "CompleteControlPlaneUpgradeRequest", "LinuxNodeConfig", "WindowsNodeConfig", "NodeKubeletConfig", @@ -80,6 +81,7 @@ "ParallelstoreCsiDriverConfig", "HighScaleCheckpointingConfig", "LustreCsiDriverConfig", + "SliceControllerConfig", "RayOperatorConfig", "PrivateClusterMasterGlobalAccessConfig", "PrivateClusterConfig", @@ -199,6 +201,7 @@ "ShieldedNodes", "VirtualNIC", "FastSocket", + "GPUDirectConfig", "GetOpenIDConfigRequest", "GetOpenIDConfigResponse", "GetJSONWebKeysRequest", @@ -211,6 +214,8 @@ "CostManagementConfig", "TpuConfig", "Master", + "CompatibilityStatus", + "RollbackSafeUpgrade", "AutopilotConversionStatus", "Autopilot", "PrivilegedAdmissionConfig", @@ -219,6 +224,7 @@ "ConfidentialNodes", "UpgradeEvent", "UpgradeInfoEvent", + "DisruptionEvent", "UpgradeAvailableEvent", "SecurityBulletinEvent", "IdentityServiceConfig", @@ -242,12 +248,15 @@ "SecondaryBootDiskUpdateStrategy", "FetchClusterUpgradeInfoRequest", "ClusterUpgradeInfo", + "RollbackSafeUpgradeStatus", "UpgradeDetails", "FetchNodePoolUpgradeInfoRequest", "NodePoolUpgradeInfo", "GkeAutoUpgradeConfig", "NetworkTierConfig", "SecretSyncConfig", + "ManagedOpenTelemetryConfig", + "PodSnapshotConfig", }, ) @@ -305,10 +314,15 @@ class NodePoolUpdateStrategy(proto.Enum): SURGE is the traditional way of upgrading a node pool. max_surge and max_unavailable determines the level of upgrade parallelism. + SHORT_LIVED (5): + SHORT_LIVED is the dedicated upgrade strategy for + QueuedProvisioning and flex start nodepools scaled up only + by enqueueing to the Dynamic Workload Scheduler (DWS). """ NODE_POOL_UPDATE_STRATEGY_UNSPECIFIED = 0 BLUE_GREEN = 2 SURGE = 3 + SHORT_LIVED = 5 class DatapathProvider(proto.Enum): @@ -368,6 +382,30 @@ class InTransitEncryptionConfig(proto.Enum): IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT = 2 +class CompleteControlPlaneUpgradeRequest(proto.Message): + r"""CompleteControlPlaneUpgradeRequest sets the name of target + cluster to complete upgrade. + + Attributes: + name (str): + The name (project, location, cluster) of the cluster to + complete upgrade. Specified in the format + ``projects/*/locations/*/clusters/*``. + version (str): + API request version that initiates this + operation. + """ + + name: str = proto.Field( + proto.STRING, + number=1, + ) + version: str = proto.Field( + proto.STRING, + number=2, + ) + + class LinuxNodeConfig(proto.Message): r"""Parameters that can be configured on Linux nodes. @@ -385,18 +423,24 @@ class LinuxNodeConfig(proto.Message): net.core.rmem_default net.core.wmem_default net.core.wmem_max net.core.optmem_max net.core.somaxconn net.ipv4.tcp_rmem net.ipv4.tcp_wmem net.ipv4.tcp_tw_reuse - net.ipv4.tcp_max_orphans net.netfilter.nf_conntrack_max + net.ipv4.tcp_mtu_probing net.ipv4.tcp_max_orphans + net.ipv4.tcp_max_tw_buckets net.ipv4.tcp_syn_retries + net.ipv4.tcp_ecn net.ipv4.tcp_congestion_control + net.netfilter.nf_conntrack_max net.netfilter.nf_conntrack_buckets net.netfilter.nf_conntrack_tcp_timeout_close_wait net.netfilter.nf_conntrack_tcp_timeout_time_wait net.netfilter.nf_conntrack_tcp_timeout_established net.netfilter.nf_conntrack_acct kernel.shmmni kernel.shmmax - kernel.shmall fs.aio-max-nr fs.file-max + kernel.shmall kernel.perf_event_paranoid + kernel.sched_rt_runtime_us kernel.softlockup_panic + kernel.yama.ptrace_scope kernel.kptr_restrict + kernel.dmesg_restrict kernel.sysrq fs.aio-max-nr fs.file-max fs.inotify.max_user_instances fs.inotify.max_user_watches fs.nr_open vm.dirty_background_ratio - vm.dirty_expire_centisecs vm.dirty_ratio - vm.dirty_writeback_centisecs vm.max_map_count - vm.overcommit_memory vm.overcommit_ratio + vm.dirty_background_bytes vm.dirty_expire_centisecs + vm.dirty_ratio vm.dirty_bytes vm.dirty_writeback_centisecs + vm.max_map_count vm.overcommit_memory vm.overcommit_ratio vm.vfs_cache_pressure vm.swappiness vm.watermark_scale_factor vm.min_free_kbytes cgroup_mode (google.cloud.container_v1beta1.types.LinuxNodeConfig.CgroupMode): @@ -1026,6 +1070,28 @@ class NodeKubeletConfig(proto.Message): individually instead of as a group. This field is a member of `oneof`_ ``_single_process_oom_kill``. + shutdown_grace_period_seconds (int): + Optional. shutdown_grace_period_seconds is the maximum + allowed grace period (in seconds) the total duration that + the node should delay the shutdown during a graceful + shutdown. This is the total grace period for pod termination + for both regular and critical pods. + https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/ + If set to 0, node will not enable the graceful node shutdown + functionality. This field is only valid for Spot VMs. + Allowed values: 0, 30, 120. + + This field is a member of `oneof`_ ``_shutdown_grace_period_seconds``. + shutdown_grace_period_critical_pods_seconds (int): + Optional. shutdown_grace_period_critical_pod_seconds is the + maximum allowed grace period (in seconds) used to terminate + critical pods during a node shutdown. This value should be + <= shutdown_grace_period_seconds, and is only valid if + shutdown_grace_period_seconds is set. + https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/ + Range: [0, 120]. + + This field is a member of `oneof`_ ``_shutdown_grace_period_critical_pods_seconds``. """ cpu_manager_policy: str = proto.Field( @@ -1116,6 +1182,16 @@ class NodeKubeletConfig(proto.Message): number=22, optional=True, ) + shutdown_grace_period_seconds: int = proto.Field( + proto.INT32, + number=26, + optional=True, + ) + shutdown_grace_period_critical_pods_seconds: int = proto.Field( + proto.INT32, + number=27, + optional=True, + ) class TopologyManager(proto.Message): @@ -1657,6 +1733,10 @@ class NodeConfig(proto.Message): Secondary boot disk update strategy. This field is a member of `oneof`_ ``_secondary_boot_disk_update_strategy``. + gpu_direct_config (google.cloud.container_v1beta1.types.GPUDirectConfig): + The configuration for GPU Direct + + This field is a member of `oneof`_ ``_gpu_direct_config``. max_run_duration (google.protobuf.duration_pb2.Duration): The maximum duration for the nodes to exist. If unspecified, the nodes can exist @@ -1677,6 +1757,12 @@ class NodeConfig(proto.Message): This field is a member of `oneof`_ ``_flex_start``. boot_disk (google.cloud.container_v1beta1.types.BootDisk): Boot disk configuration for the node pool. + consolidation_delay (google.protobuf.duration_pb2.Duration): + Consolidation delay defines duration after + which the Cluster Autoscaler can scale down + underutilized nodes. If not set, nodes are + scaled down by default behavior, i.e. according + to the chosen autoscaling profile. """ class LocalSsdEncryptionMode(proto.Enum): @@ -1920,6 +2006,12 @@ class EffectiveCgroupMode(proto.Enum): message="SecondaryBootDiskUpdateStrategy", ) ) + gpu_direct_config: "GPUDirectConfig" = proto.Field( + proto.MESSAGE, + number=51, + optional=True, + message="GPUDirectConfig", + ) max_run_duration: duration_pb2.Duration = proto.Field( proto.MESSAGE, number=53, @@ -1946,6 +2038,11 @@ class EffectiveCgroupMode(proto.Enum): number=57, message="BootDisk", ) + consolidation_delay: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=60, + message=duration_pb2.Duration, + ) class AdvancedMachineFeatures(proto.Message): @@ -2101,13 +2198,20 @@ class NodeNetworkConfig(proto.Message): The ratio is Usage/[Total number of IPs in the secondary range], Usage=numNodes\ *numZones*\ podIPsPerNode. subnetwork (str): - Output only. The subnetwork path for the node - pool. Format: + Optional. The subnetwork name/path for the + node pool. Format: projects/{project}/regions/{region}/subnetworks/{subnetwork} If the cluster is associated with multiple - subnetworks, the subnetwork for the node pool is - picked based on the IP utilization during node - pool creation and is immutable. + subnetworks, the subnetwork can be either: + + 1. A user supplied subnetwork name/full path + during node pool creation. Example1: + my-subnet + Example2: + projects/gke-project/regions/us-central1/subnetworks/my-subnet + 2. A subnetwork path picked based on the IP + utilization during node pool creation and + is immutable. network_tier_config (google.cloud.container_v1beta1.types.NetworkTierConfig): Output only. The network tier configuration for the node pool inherits from the @@ -2626,6 +2730,10 @@ class ContainerdConfig(proto.Message): writable_cgroups (google.cloud.container_v1beta1.types.ContainerdConfig.WritableCgroups): Optional. WritableCgroups defines writable cgroups configuration for the node pool. + registry_hosts (MutableSequence[google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig]): + RegistryHostConfig configures containerd registry host + configuration. Each registry_hosts represents a hosts.toml + file. At most 25 registry_hosts are allowed. """ class PrivateRegistryAccessConfig(proto.Message): @@ -2714,6 +2822,218 @@ class WritableCgroups(proto.Message): number=1, ) + class RegistryHostConfig(proto.Message): + r"""RegistryHostConfig configures the top-level structure for a + single containerd registry server's configuration, which + represents one hosts.toml file on the node. It will override the + same fqdns in PrivateRegistryAccessConfig. + + Attributes: + server (str): + Defines the host name of the registry server, + which will be used to create configuration file + as /etc/containerd/hosts.d//hosts.toml. + It supports fully qualified domain names (FQDN) + and IP addresses: + + Specifying port is supported. + Wildcards are NOT supported. + Examples: + + - my.customdomain.com + - 10.0.1.2:5000 + hosts (MutableSequence[google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.HostConfig]): + HostConfig configures a list of host-specific + configurations for the server. + Each server can have at most 10 host + configurations. + """ + + class HostCapability(proto.Enum): + r"""HostCapability configures capabilities for the registry host. + + Values: + HOST_CAPABILITY_UNSPECIFIED (0): + UNKNOWN should never be set. + HOST_CAPABILITY_PULL (1): + Pull represents the capability to fetch + manifests and blobs by digest. + HOST_CAPABILITY_RESOLVE (2): + Resolve represents the capability to fetch + manifests by name. + HOST_CAPABILITY_PUSH (3): + Push represents the capability to push blobs + and manifests. + """ + HOST_CAPABILITY_UNSPECIFIED = 0 + HOST_CAPABILITY_PULL = 1 + HOST_CAPABILITY_RESOLVE = 2 + HOST_CAPABILITY_PUSH = 3 + + class CertificateConfig(proto.Message): + r"""CertificateConfig configures certificate for the registry. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gcp_secret_manager_secret_uri (str): + The URI configures a secret from `Secret + Manager `__ in the + format + "projects/$PROJECT_ID/secrets/$SECRET_NAME/versions/$VERSION" + for global secret or + "projects/$PROJECT_ID/locations/$REGION/secrets/$SECRET_NAME/versions/$VERSION" + for regional secret. Version can be fixed (e.g. "2") or + "latest". + + This field is a member of `oneof`_ ``certificate``. + """ + + gcp_secret_manager_secret_uri: str = proto.Field( + proto.STRING, + number=1, + oneof="certificate", + ) + + class CertificateConfigPair(proto.Message): + r"""CertificateConfigPair configures pairs of certificates, which + is used for client certificate and key pairs under a registry. + + Attributes: + cert (google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.CertificateConfig): + Cert configures the client certificate. + key (google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.CertificateConfig): + Key configures the client private key. + Optional. + """ + + cert: "ContainerdConfig.RegistryHostConfig.CertificateConfig" = proto.Field( + proto.MESSAGE, + number=1, + message="ContainerdConfig.RegistryHostConfig.CertificateConfig", + ) + key: "ContainerdConfig.RegistryHostConfig.CertificateConfig" = proto.Field( + proto.MESSAGE, + number=2, + message="ContainerdConfig.RegistryHostConfig.CertificateConfig", + ) + + class RegistryHeader(proto.Message): + r"""RegistryHeader configures headers for the registry. + + Attributes: + key (str): + Key configures the header key. + value (MutableSequence[str]): + Value configures the header value. + """ + + key: str = proto.Field( + proto.STRING, + number=1, + ) + value: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=2, + ) + + class HostConfig(proto.Message): + r"""HostConfig configures the registry host under a given Server. + + Attributes: + host (str): + Host configures the registry host/mirror. + It supports fully qualified domain names (FQDN) + and IP addresses: + + Specifying port is supported. + Wildcards are NOT supported. + Examples: + + - my.customdomain.com + - 10.0.1.2:5000 + capabilities (MutableSequence[google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.HostCapability]): + Capabilities represent the capabilities of + the registry host, specifying what operations a + host is capable of performing. If not set, + containerd enables all capabilities by default. + override_path (bool): + OverridePath is used to indicate the host's + API root endpoint is defined in the URL path + rather than by the API specification. This may + be used with non-compliant OCI registries which + are missing the /v2 prefix. + If not set, containerd sets default false. + header (MutableSequence[google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.RegistryHeader]): + Header configures the registry host headers. + ca (MutableSequence[google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.CertificateConfig]): + CA configures the registry host certificate. + client (MutableSequence[google.cloud.container_v1beta1.types.ContainerdConfig.RegistryHostConfig.CertificateConfigPair]): + Client configures the registry host client + certificate and key. + dial_timeout (google.protobuf.duration_pb2.Duration): + Specifies the maximum duration allowed for a connection + attempt to complete. A shorter timeout helps reduce delays + when falling back to the original registry if the mirror is + unreachable. Maximum allowed value is 180s. If not set, + containerd sets default 30s. The value should be a decimal + number of seconds with an ``s`` suffix. + """ + + host: str = proto.Field( + proto.STRING, + number=1, + ) + capabilities: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.HostCapability" + ] = proto.RepeatedField( + proto.ENUM, + number=2, + enum="ContainerdConfig.RegistryHostConfig.HostCapability", + ) + override_path: bool = proto.Field( + proto.BOOL, + number=3, + ) + header: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.RegistryHeader" + ] = proto.RepeatedField( + proto.MESSAGE, + number=4, + message="ContainerdConfig.RegistryHostConfig.RegistryHeader", + ) + ca: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.CertificateConfig" + ] = proto.RepeatedField( + proto.MESSAGE, + number=5, + message="ContainerdConfig.RegistryHostConfig.CertificateConfig", + ) + client: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.CertificateConfigPair" + ] = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="ContainerdConfig.RegistryHostConfig.CertificateConfigPair", + ) + dial_timeout: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=7, + message=duration_pb2.Duration, + ) + + server: str = proto.Field( + proto.STRING, + number=1, + ) + hosts: MutableSequence[ + "ContainerdConfig.RegistryHostConfig.HostConfig" + ] = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="ContainerdConfig.RegistryHostConfig.HostConfig", + ) + private_registry_access_config: PrivateRegistryAccessConfig = proto.Field( proto.MESSAGE, number=1, @@ -2724,6 +3044,11 @@ class WritableCgroups(proto.Message): number=2, message=WritableCgroups, ) + registry_hosts: MutableSequence[RegistryHostConfig] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message=RegistryHostConfig, + ) class HostMaintenancePolicy(proto.Message): @@ -3117,6 +3442,11 @@ class AddonsConfig(proto.Message): Checkpointing add-on. lustre_csi_driver_config (google.cloud.container_v1beta1.types.LustreCsiDriverConfig): Configuration for the Lustre CSI driver. + pod_snapshot_config (google.cloud.container_v1beta1.types.PodSnapshotConfig): + Configuration for the Pod Snapshot feature. + slice_controller_config (google.cloud.container_v1beta1.types.SliceControllerConfig): + Optional. Configuration for the slice + controller add-on. """ http_load_balancing: "HttpLoadBalancing" = proto.Field( @@ -3211,6 +3541,16 @@ class AddonsConfig(proto.Message): number=23, message="LustreCsiDriverConfig", ) + pod_snapshot_config: "PodSnapshotConfig" = proto.Field( + proto.MESSAGE, + number=24, + message="PodSnapshotConfig", + ) + slice_controller_config: "SliceControllerConfig" = proto.Field( + proto.MESSAGE, + number=26, + message="SliceControllerConfig", + ) class HttpLoadBalancing(proto.Message): @@ -3441,16 +3781,17 @@ class LustreCsiDriverConfig(proto.Message): Whether the Lustre CSI driver is enabled for this cluster. enable_legacy_lustre_port (bool): - If set to true, the Lustre CSI driver will - install Lustre kernel modules using port 6988. - This serves as a workaround for a port conflict - with the gke-metadata-server. This field is - required ONLY under the following conditions: + If set to true, the Lustre CSI driver will install Lustre + kernel modules using port 6988. This serves as a workaround + for a port conflict with the gke-metadata-server. This field + is required ONLY under the following conditions: - 1. The GKE node version is older than - 1.33.2-gke.4655000. - 2. You're connecting to a Lustre instance that - has the 'gke-support-enabled' flag. + 1. The GKE node version is older than 1.33.2-gke.4655000. + 2. You're connecting to a Lustre instance that has the + 'gke-support-enabled' flag. Deprecated: This flag is no + longer required as of GKE node version + 1.33.2-gke.4655000, unless you are connecting to a Lustre + instance that has the ``gke-support-enabled`` flag. """ enabled: bool = proto.Field( @@ -3463,6 +3804,21 @@ class LustreCsiDriverConfig(proto.Message): ) +class SliceControllerConfig(proto.Message): + r"""Configuration for the Slice Controller. + + Attributes: + enabled (bool): + Optional. Indicates whether Slice Controller + is enabled in the cluster. + """ + + enabled: bool = proto.Field( + proto.BOOL, + number=1, + ) + + class RayOperatorConfig(proto.Message): r"""Configuration options for the Ray Operator add-on. @@ -3875,7 +4231,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3890,7 +4246,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3908,7 +4264,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. @@ -3943,7 +4299,7 @@ class IPAllocationPolicy(proto.Message): specific netmask. Set to a - `CIDR `__ + `CIDR `__ notation (e.g. ``10.96.0.0/14``) from the RFC-1918 private networks (e.g. ``10.0.0.0/8``, ``172.16.0.0/12``, ``192.168.0.0/16``) to pick a specific range to use. This @@ -4392,7 +4748,7 @@ class Cluster(proto.Message): cluster_ipv4_cidr (str): The IP address range of the container pods in this cluster, in - `CIDR `__ + `CIDR `__ 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``. @@ -4584,6 +4940,16 @@ class Cluster(proto.Message): current_master_version (str): Output only. The current software version of the master endpoint. + current_emulated_version (str): + Output only. The current emulated version of + the master endpoint. The version is in minor + version format, e.g. 1.30. No value or empty + string means the cluster has no emulated + version. + rollback_safe_upgrade (google.cloud.container_v1beta1.types.RollbackSafeUpgrade): + The rollback safe upgrade information of the + cluster. This field is used when user manually + triggers a rollback safe upgrade. current_node_version (str): Output only. Deprecated, use `NodePool.version `__ @@ -4610,7 +4976,7 @@ class Cluster(proto.Message): services_ipv4_cidr (str): Output only. The IP address range of the Kubernetes services in this cluster, in - `CIDR `__ + `CIDR `__ notation (e.g. ``1.2.3.4/29``). Service addresses are typically put in the last ``/16`` from the container CIDR. instance_group_urls (MutableSequence[str]): @@ -4638,7 +5004,7 @@ class Cluster(proto.Message): tpu_ipv4_cidr_block (str): Output only. The IP address range of the Cloud TPUs in this cluster, in - `CIDR `__ + `CIDR `__ notation (e.g. ``1.2.3.4/29``). This field is deprecated due to the deprecation of 2VM TPU. The end of life date for 2VM TPU is 2025-04-25. @@ -4726,6 +5092,9 @@ class Cluster(proto.Message): secret_sync_config (google.cloud.container_v1beta1.types.SecretSyncConfig): Configuration for sync Secret Manager secrets as k8s secrets. + managed_opentelemetry_config (google.cloud.container_v1beta1.types.ManagedOpenTelemetryConfig): + Configuration for Managed OpenTelemetry + pipeline. """ class Status(proto.Enum): @@ -5000,6 +5369,15 @@ class Status(proto.Enum): proto.STRING, number=104, ) + current_emulated_version: str = proto.Field( + proto.STRING, + number=167, + ) + rollback_safe_upgrade: "RollbackSafeUpgrade" = proto.Field( + proto.MESSAGE, + number=170, + message="RollbackSafeUpgrade", + ) current_node_version: str = proto.Field( proto.STRING, number=105, @@ -5176,6 +5554,11 @@ class Status(proto.Enum): number=166, message="SecretSyncConfig", ) + managed_opentelemetry_config: "ManagedOpenTelemetryConfig" = proto.Field( + proto.MESSAGE, + number=168, + message="ManagedOpenTelemetryConfig", + ) class RBACBindingConfig(proto.Message): @@ -5248,6 +5631,10 @@ class UserManagedKeysConfig(proto.Message): The Cloud KMS cryptoKey to use for Confidential Hyperdisk on the control plane nodes. + control_plane_disk_encryption_key_versions (MutableSequence[str]): + Output only. All of the versions of the Cloud + KMS cryptoKey that are used by Confidential + Hyperdisks on the control plane nodes. gkeops_etcd_backup_encryption_key (str): Resource path of the Cloud KMS cryptoKey to use for encryption of internal etcd backups. @@ -5281,6 +5668,12 @@ class UserManagedKeysConfig(proto.Message): proto.STRING, number=16, ) + control_plane_disk_encryption_key_versions: MutableSequence[ + str + ] = proto.RepeatedField( + proto.STRING, + number=18, + ) gkeops_etcd_backup_encryption_key: str = proto.Field( proto.STRING, number=17, @@ -6073,6 +6466,15 @@ class ClusterUpdate(proto.Message): desired_secret_sync_config (google.cloud.container_v1beta1.types.SecretSyncConfig): Configuration for sync Secret Manager secrets as k8s secrets. + desired_privileged_admission_config (google.cloud.container_v1beta1.types.PrivilegedAdmissionConfig): + The desired privileged admission config for + the cluster. + desired_rollback_safe_upgrade (google.cloud.container_v1beta1.types.RollbackSafeUpgrade): + The desired rollback safe upgrade + configuration. + desired_managed_opentelemetry_config (google.cloud.container_v1beta1.types.ManagedOpenTelemetryConfig): + The desired managed open telemetry + configuration. """ desired_node_version: str = proto.Field( @@ -6490,6 +6892,21 @@ class ClusterUpdate(proto.Message): number=158, message="SecretSyncConfig", ) + desired_privileged_admission_config: "PrivilegedAdmissionConfig" = proto.Field( + proto.MESSAGE, + number=159, + message="PrivilegedAdmissionConfig", + ) + desired_rollback_safe_upgrade: "RollbackSafeUpgrade" = proto.Field( + proto.MESSAGE, + number=161, + message="RollbackSafeUpgrade", + ) + desired_managed_opentelemetry_config: "ManagedOpenTelemetryConfig" = proto.Field( + proto.MESSAGE, + number=163, + message="ManagedOpenTelemetryConfig", + ) class AdditionalPodRangesConfig(proto.Message): @@ -6532,8 +6949,32 @@ class AdditionalIPRangesConfig(proto.Message): subnetwork that can be used for pod IPs. Example1: gke-pod-range1 Example2: gke-pod-range1,gke-pod-range2 + status (google.cloud.container_v1beta1.types.AdditionalIPRangesConfig.Status): + Draining status of the additional subnet. """ + class Status(proto.Enum): + r"""Additional subnet with DRAINING status will not be selected during + new node pool creation. To undrain the draining status, update the + cluster to set the sunbet to ACTIVE status. To remove the additional + subnet, use the update cluster API to remove the subnet from the + desired_additional_ip_ranges list. IP ranges can be removed + regardless of its status, as long as no node pools are using them. + + Values: + STATUS_UNSPECIFIED (0): + Not set, same as ACTIVE. + ACTIVE (1): + ACTIVE status indicates that the subnet is + available for new node pool creation. + DRAINING (2): + DRAINING status indicates that the subnet is + not used for new node pool creation. + """ + STATUS_UNSPECIFIED = 0 + ACTIVE = 1 + DRAINING = 2 + subnetwork: str = proto.Field( proto.STRING, number=1, @@ -6542,6 +6983,11 @@ class AdditionalIPRangesConfig(proto.Message): proto.STRING, number=2, ) + status: Status = proto.Field( + proto.ENUM, + number=3, + enum=Status, + ) class DesiredAdditionalIPRangesConfig(proto.Message): @@ -7325,6 +7771,15 @@ class UpdateNodePoolRequest(proto.Message): node pool. Initiates an upgrade operation that migrates the nodes in the node pool to the specified boot disk config. + node_drain_config (google.cloud.container_v1beta1.types.NodePool.NodeDrainConfig): + The desired node drain configuration for + nodes in the node pool. + consolidation_delay (google.protobuf.duration_pb2.Duration): + Consolidation delay defines duration after + which the Cluster Autoscaler can scale down + underutilized nodes. If not set, nodes are + scaled down by default behavior, i.e. according + to the chosen autoscaling profile. """ project_id: str = proto.Field( @@ -7489,6 +7944,16 @@ class UpdateNodePoolRequest(proto.Message): number=47, message="BootDisk", ) + node_drain_config: "NodePool.NodeDrainConfig" = proto.Field( + proto.MESSAGE, + number=48, + message="NodePool.NodeDrainConfig", + ) + consolidation_delay: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=49, + message=duration_pb2.Duration, + ) class SetNodePoolAutoscalingRequest(proto.Message): @@ -8794,6 +9259,9 @@ class NodePool(proto.Message): provisioning. best_effort_provisioning (google.cloud.container_v1beta1.types.BestEffortProvisioning): Enable best effort provisioning for nodes + node_drain_config (google.cloud.container_v1beta1.types.NodePool.NodeDrainConfig): + Specifies the node drain configuration for + this node pool. """ class Status(proto.Enum): @@ -9091,6 +9559,27 @@ class QueuedProvisioning(proto.Message): number=1, ) + class NodeDrainConfig(proto.Message): + r"""NodeDrainConfig contains the node drain related + configurations for this nodepool. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + respect_pdb_during_node_pool_deletion (bool): + Whether to respect PDB during node pool + deletion. + + This field is a member of `oneof`_ ``_respect_pdb_during_node_pool_deletion``. + """ + + respect_pdb_during_node_pool_deletion: bool = proto.Field( + proto.BOOL, + number=3, + optional=True, + ) + name: str = proto.Field( proto.STRING, number=1, @@ -9187,6 +9676,11 @@ class QueuedProvisioning(proto.Message): number=113, message="BestEffortProvisioning", ) + node_drain_config: NodeDrainConfig = proto.Field( + proto.MESSAGE, + number=116, + message=NodeDrainConfig, + ) class NodeManagement(proto.Message): @@ -9739,6 +10233,9 @@ class ClusterAutoscaling(proto.Message): default_compute_class_config (google.cloud.container_v1beta1.types.DefaultComputeClassConfig): Default compute class is a configuration for default compute class. + autopilot_general_profile (google.cloud.container_v1beta1.types.ClusterAutoscaling.AutopilotGeneralProfile): + Autopilot general profile for the cluster, + which defines the configuration for the cluster. """ class AutoscalingProfile(proto.Enum): @@ -9758,6 +10255,18 @@ class AutoscalingProfile(proto.Enum): OPTIMIZE_UTILIZATION = 1 BALANCED = 2 + class AutopilotGeneralProfile(proto.Enum): + r"""Defines possible options for Autopilot general profile. + + Values: + AUTOPILOT_GENERAL_PROFILE_UNSPECIFIED (0): + Use default configuration. + NO_PERFORMANCE (1): + Avoid extra IP consumption. + """ + AUTOPILOT_GENERAL_PROFILE_UNSPECIFIED = 0 + NO_PERFORMANCE = 1 + enable_node_autoprovisioning: bool = proto.Field( proto.BOOL, number=1, @@ -9788,6 +10297,11 @@ class AutoscalingProfile(proto.Enum): number=9, message="DefaultComputeClassConfig", ) + autopilot_general_profile: AutopilotGeneralProfile = proto.Field( + proto.ENUM, + number=14, + enum=AutopilotGeneralProfile, + ) class AutoprovisioningNodePoolDefaults(proto.Message): @@ -11752,6 +12266,43 @@ class FastSocket(proto.Message): ) +class GPUDirectConfig(proto.Message): + r"""GPUDirectConfig specifies the GPU direct strategy on the node + pool. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + gpu_direct_strategy (google.cloud.container_v1beta1.types.GPUDirectConfig.GPUDirectStrategy): + The type of GPU direct strategy to enable on + the node pool. + + This field is a member of `oneof`_ ``_gpu_direct_strategy``. + """ + + class GPUDirectStrategy(proto.Enum): + r"""Option for GPU direct Strategies + + Values: + GPU_DIRECT_STRATEGY_UNSPECIFIED (0): + Default value. No GPU Direct strategy is + enabled on the node. + RDMA (2): + GPUDirect-RDMA on A3 Ultra, and A4 machine + types + """ + GPU_DIRECT_STRATEGY_UNSPECIFIED = 0 + RDMA = 2 + + gpu_direct_strategy: GPUDirectStrategy = proto.Field( + proto.ENUM, + number=1, + optional=True, + enum=GPUDirectStrategy, + ) + + class GetOpenIDConfigRequest(proto.Message): r"""GetOpenIDConfigRequest gets the OIDC discovery document for the cluster. See the OpenID Connect Discovery 1.0 specification @@ -12136,7 +12687,67 @@ class TpuConfig(proto.Message): class Master(proto.Message): - r"""Master is the configuration for components on master.""" + r"""Master is the configuration for components on master. + + Attributes: + compatibility_status (google.cloud.container_v1beta1.types.CompatibilityStatus): + Output only. The compatibility status of the + control plane. It should be empty if the cluster + does not have emulated version. + """ + + compatibility_status: "CompatibilityStatus" = proto.Field( + proto.MESSAGE, + number=3, + message="CompatibilityStatus", + ) + + +class CompatibilityStatus(proto.Message): + r"""CompatibilityStatus is the status regarding the control + plane's compatibility. + + Attributes: + downgradable_version (str): + Output only. The GKE version that the cluster + can be safely downgraded to if the cluster is + emulating the previous minor version. It is + usually the cluster's previous version before a + minor version upgrade. + emulated_version_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. Last time the control plane + became available after a minor version binary + upgrade with emulated version set. It indicates + the last time the cluster entered the rollback + safe mode. + """ + + downgradable_version: str = proto.Field( + proto.STRING, + number=1, + ) + emulated_version_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + + +class RollbackSafeUpgrade(proto.Message): + r"""RollbackSafeUpgrade is the configuration for the rollback + safe upgrade. + + Attributes: + control_plane_soak_duration (google.protobuf.duration_pb2.Duration): + A user-defined period for the cluster remains + in the rollbackable state. ex: {seconds: 21600}. + """ + + control_plane_soak_duration: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=1, + message=duration_pb2.Duration, + ) class AutopilotConversionStatus(proto.Message): @@ -12505,6 +13116,11 @@ class UpgradeInfoEvent(proto.Message): A brief description of the event. event_type (google.cloud.container_v1beta1.types.UpgradeInfoEvent.EventType): The type of the event. + disruption_event (google.cloud.container_v1beta1.types.DisruptionEvent): + The information about the disruption event. This field is + only populated when event_type is DISRUPTION_EVENT. + + This field is a member of `oneof`_ ``_disruption_event``. """ class State(proto.Enum): @@ -12547,11 +13163,15 @@ class EventType(proto.Enum): UPGRADE_LIFECYCLE (3): UPGRADE_LIFECYCLE indicates the event is about the upgrade lifecycle. + DISRUPTION_EVENT (4): + DISRUPTION_EVENT indicates the event is about the + disruption. """ EVENT_TYPE_UNSPECIFIED = 0 END_OF_SUPPORT = 1 COS_MILESTONE_VERSION_UPDATE = 2 UPGRADE_LIFECYCLE = 3 + DISRUPTION_EVENT = 4 resource_type: "UpgradeResourceType" = proto.Field( proto.ENUM, @@ -12618,6 +13238,98 @@ class EventType(proto.Enum): number=12, enum=EventType, ) + disruption_event: "DisruptionEvent" = proto.Field( + proto.MESSAGE, + number=14, + optional=True, + message="DisruptionEvent", + ) + + +class DisruptionEvent(proto.Message): + r"""DisruptionEvent is a notification sent to customers about the + disruption event of a resource. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + disruption_type (google.cloud.container_v1beta1.types.DisruptionEvent.DisruptionType): + The type of the disruption event. + pdb_blocked_node (str): + The node whose drain is blocked by PDB. This field is set + for both POD_PDB_VIOLATION and POD_NOT_ENOUGH_PDB event. + pdb_blocked_pod (MutableSequence[google.cloud.container_v1beta1.types.DisruptionEvent.PdbBlockedPod]): + The pods whose evictions are blocked by PDB. This field is + set for both POD_PDB_VIOLATION and POD_NOT_ENOUGH_PDB event. + pdb_violation_timeout (google.protobuf.duration_pb2.Duration): + The timeout in seconds for which the node drain is blocked + by PDB. After this timeout, pods are forcefully evicted. + This field is only populated when event_type is + POD_PDB_VIOLATION. + + This field is a member of `oneof`_ ``_pdb_violation_timeout``. + """ + + class DisruptionType(proto.Enum): + r"""The type of the disruption event. + + Values: + DISRUPTION_TYPE_UNSPECIFIED (0): + DISRUPTION_TYPE_UNSPECIFIED indicates the disruption type is + unspecified. + POD_NOT_ENOUGH_PDB (1): + POD_NOT_ENOUGH_PDB indicates there are still running pods on + the node during node drain because their evictions are + blocked by PDB. + POD_PDB_VIOLATION (2): + POD_PDB_VIOLATION indicates that there are force pod + evictions during node drain which violate the PDB. + """ + DISRUPTION_TYPE_UNSPECIFIED = 0 + POD_NOT_ENOUGH_PDB = 1 + POD_PDB_VIOLATION = 2 + + class PdbBlockedPod(proto.Message): + r"""The namespace/name of the pod whose eviction is blocked by + PDB. + + Attributes: + namespace (str): + The namespace of the pod. + name (str): + The name of the pod. + """ + + namespace: str = proto.Field( + proto.STRING, + number=1, + ) + name: str = proto.Field( + proto.STRING, + number=2, + ) + + disruption_type: DisruptionType = proto.Field( + proto.ENUM, + number=1, + enum=DisruptionType, + ) + pdb_blocked_node: str = proto.Field( + proto.STRING, + number=2, + ) + pdb_blocked_pod: MutableSequence[PdbBlockedPod] = proto.RepeatedField( + proto.MESSAGE, + number=3, + message=PdbBlockedPod, + ) + pdb_violation_timeout: duration_pb2.Duration = proto.Field( + proto.MESSAGE, + number=4, + optional=True, + message=duration_pb2.Duration, + ) class UpgradeAvailableEvent(proto.Message): @@ -13592,6 +14304,8 @@ class ClusterUpgradeInfo(proto.Message): extended support timestamp. This field is a member of `oneof`_ ``_end_of_extended_support_timestamp``. + rollback_safe_upgrade_status (google.cloud.container_v1beta1.types.RollbackSafeUpgradeStatus): + The cluster's rollback-safe upgrade status. """ class AutoUpgradeStatus(proto.Enum): @@ -13685,6 +14399,55 @@ class AutoUpgradePausedReason(proto.Enum): number=6, optional=True, ) + rollback_safe_upgrade_status: "RollbackSafeUpgradeStatus" = proto.Field( + proto.MESSAGE, + number=9, + message="RollbackSafeUpgradeStatus", + ) + + +class RollbackSafeUpgradeStatus(proto.Message): + r"""RollbackSafeUpgradeStatus contains the rollback-safe upgrade + status of a cluster. + + Attributes: + mode (google.cloud.container_v1beta1.types.RollbackSafeUpgradeStatus.Mode): + The mode of the rollback-safe upgrade. + control_plane_upgrade_rollback_end_time (google.protobuf.timestamp_pb2.Timestamp): + The rollback-safe mode expiration time. + previous_version (str): + The GKE version that the cluster previously + used before step-one upgrade. + """ + + class Mode(proto.Enum): + r"""Mode indicates the mode of the rollback-safe upgrade. + + Values: + MODE_UNSPECIFIED (0): + MODE_UNSPECIFIED means it's in regular upgrade mode. + KCP_MINOR_UPGRADE_ROLLBACK_SAFE_MODE (1): + KCP_MINOR_UPGRADE_ROLLBACK_SAFE_MODE means it's in + rollback-safe mode after a KCP minor version step-one + upgrade. + """ + MODE_UNSPECIFIED = 0 + KCP_MINOR_UPGRADE_ROLLBACK_SAFE_MODE = 1 + + mode: Mode = proto.Field( + proto.ENUM, + number=1, + enum=Mode, + ) + control_plane_upgrade_rollback_end_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + previous_version: str = proto.Field( + proto.STRING, + number=3, + ) class UpgradeDetails(proto.Message): @@ -13711,6 +14474,10 @@ class UpgradeDetails(proto.Message): The version after the upgrade. start_type (google.cloud.container_v1beta1.types.UpgradeDetails.StartType): The start type of the upgrade. + initial_emulated_version (str): + The emulated version before the upgrade. + target_emulated_version (str): + The emulated version after the upgrade. """ class State(proto.Enum): @@ -13779,6 +14546,14 @@ class StartType(proto.Enum): number=6, enum=StartType, ) + initial_emulated_version: str = proto.Field( + proto.STRING, + number=7, + ) + target_emulated_version: str = proto.Field( + proto.STRING, + number=8, + ) class FetchNodePoolUpgradeInfoRequest(proto.Message): @@ -14063,4 +14838,60 @@ class SyncRotationConfig(proto.Message): ) +class ManagedOpenTelemetryConfig(proto.Message): + r"""ManagedOpenTelemetryConfig is the configuration for the GKE + Managed OpenTelemetry pipeline. + + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + scope (google.cloud.container_v1beta1.types.ManagedOpenTelemetryConfig.Scope): + Scope of the Managed OpenTelemetry pipeline. + + This field is a member of `oneof`_ ``_scope``. + """ + + class Scope(proto.Enum): + r"""Scope is the scope of the Managed OpenTelemetry pipeline. + + Values: + SCOPE_UNSPECIFIED (0): + SCOPE_UNSPECIFIED is when the scope is not set. + NONE (1): + NONE is used to disable the Managed + OpenTelemetry pipeline. + COLLECTION_AND_INSTRUMENTATION_COMPONENTS (2): + COLLECTION_AND_INSTRUMENTATION_COMPONENTS is used to enable + the Managed OpenTelemetry pipeline for collection and + instrumentation components. + """ + SCOPE_UNSPECIFIED = 0 + NONE = 1 + COLLECTION_AND_INSTRUMENTATION_COMPONENTS = 2 + + scope: Scope = proto.Field( + proto.ENUM, + number=1, + optional=True, + enum=Scope, + ) + + +class PodSnapshotConfig(proto.Message): + r"""PodSnapshotConfig is the configuration for GKE Pod Snapshots + feature. + + Attributes: + enabled (bool): + Whether or not the Pod Snapshots feature is + enabled. + """ + + enabled: bool = proto.Field( + proto.BOOL, + number=1, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_async.py b/packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_async.py new file mode 100644 index 000000000000..5e9d658f4d3a --- /dev/null +++ b/packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompleteControlPlaneUpgrade +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-container + + +# [START container_v1beta1_generated_ClusterManager_CompleteControlPlaneUpgrade_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import container_v1beta1 + + +async def sample_complete_control_plane_upgrade(): + # Create a client + client = container_v1beta1.ClusterManagerAsyncClient() + + # Initialize request argument(s) + request = container_v1beta1.CompleteControlPlaneUpgradeRequest() + + # Make the request + response = await client.complete_control_plane_upgrade(request=request) + + # Handle the response + print(response) + + +# [END container_v1beta1_generated_ClusterManager_CompleteControlPlaneUpgrade_async] diff --git a/packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_sync.py b/packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_sync.py new file mode 100644 index 000000000000..e05ec6a1d8fd --- /dev/null +++ b/packages/google-cloud-container/samples/generated_samples/container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CompleteControlPlaneUpgrade +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-container + + +# [START container_v1beta1_generated_ClusterManager_CompleteControlPlaneUpgrade_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import container_v1beta1 + + +def sample_complete_control_plane_upgrade(): + # Create a client + client = container_v1beta1.ClusterManagerClient() + + # Initialize request argument(s) + request = container_v1beta1.CompleteControlPlaneUpgradeRequest() + + # Make the request + response = client.complete_control_plane_upgrade(request=request) + + # Handle the response + print(response) + + +# [END container_v1beta1_generated_ClusterManager_CompleteControlPlaneUpgrade_sync] diff --git a/packages/google-cloud-container/samples/generated_samples/snippet_metadata_google.container.v1beta1.json b/packages/google-cloud-container/samples/generated_samples/snippet_metadata_google.container.v1beta1.json index 2e504144d539..db1325c1afbb 100644 --- a/packages/google-cloud-container/samples/generated_samples/snippet_metadata_google.container.v1beta1.json +++ b/packages/google-cloud-container/samples/generated_samples/snippet_metadata_google.container.v1beta1.json @@ -335,6 +335,159 @@ ], "title": "container_v1beta1_generated_cluster_manager_check_autopilot_compatibility_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.container_v1beta1.ClusterManagerAsyncClient", + "shortName": "ClusterManagerAsyncClient" + }, + "fullName": "google.cloud.container_v1beta1.ClusterManagerAsyncClient.complete_control_plane_upgrade", + "method": { + "fullName": "google.container.v1beta1.ClusterManager.CompleteControlPlaneUpgrade", + "service": { + "fullName": "google.container.v1beta1.ClusterManager", + "shortName": "ClusterManager" + }, + "shortName": "CompleteControlPlaneUpgrade" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.container_v1beta1.types.CompleteControlPlaneUpgradeRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.container_v1beta1.types.Operation", + "shortName": "complete_control_plane_upgrade" + }, + "description": "Sample for CompleteControlPlaneUpgrade", + "file": "container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "container_v1beta1_generated_ClusterManager_CompleteControlPlaneUpgrade_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.container_v1beta1.ClusterManagerClient", + "shortName": "ClusterManagerClient" + }, + "fullName": "google.cloud.container_v1beta1.ClusterManagerClient.complete_control_plane_upgrade", + "method": { + "fullName": "google.container.v1beta1.ClusterManager.CompleteControlPlaneUpgrade", + "service": { + "fullName": "google.container.v1beta1.ClusterManager", + "shortName": "ClusterManager" + }, + "shortName": "CompleteControlPlaneUpgrade" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.container_v1beta1.types.CompleteControlPlaneUpgradeRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.container_v1beta1.types.Operation", + "shortName": "complete_control_plane_upgrade" + }, + "description": "Sample for CompleteControlPlaneUpgrade", + "file": "container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "container_v1beta1_generated_ClusterManager_CompleteControlPlaneUpgrade_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "container_v1beta1_generated_cluster_manager_complete_control_plane_upgrade_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/packages/google-cloud-container/tests/unit/gapic/container_v1/test_cluster_manager.py b/packages/google-cloud-container/tests/unit/gapic/container_v1/test_cluster_manager.py index e08fa8547bfc..5759061fd164 100644 --- a/packages/google-cloud-container/tests/unit/gapic/container_v1/test_cluster_manager.py +++ b/packages/google-cloud-container/tests/unit/gapic/container_v1/test_cluster_manager.py @@ -28477,9 +28477,35 @@ def test_parse_crypto_key_version_path(): assert expected == actual -def test_topic_path(): +def test_subnetwork_path(): project = "oyster" - topic = "nudibranch" + region = "nudibranch" + subnetwork = "cuttlefish" + expected = "projects/{project}/regions/{region}/subnetworks/{subnetwork}".format( + project=project, + region=region, + subnetwork=subnetwork, + ) + actual = ClusterManagerClient.subnetwork_path(project, region, subnetwork) + assert expected == actual + + +def test_parse_subnetwork_path(): + expected = { + "project": "mussel", + "region": "winkle", + "subnetwork": "nautilus", + } + path = ClusterManagerClient.subnetwork_path(**expected) + + # Check that the path construction is reversible. + actual = ClusterManagerClient.parse_subnetwork_path(path) + assert expected == actual + + +def test_topic_path(): + project = "scallop" + topic = "abalone" expected = "projects/{project}/topics/{topic}".format( project=project, topic=topic, @@ -28490,8 +28516,8 @@ def test_topic_path(): def test_parse_topic_path(): expected = { - "project": "cuttlefish", - "topic": "mussel", + "project": "squid", + "topic": "clam", } path = ClusterManagerClient.topic_path(**expected) @@ -28501,7 +28527,7 @@ def test_parse_topic_path(): def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "whelk" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -28511,7 +28537,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "octopus", } path = ClusterManagerClient.common_billing_account_path(**expected) @@ -28521,7 +28547,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "oyster" expected = "folders/{folder}".format( folder=folder, ) @@ -28531,7 +28557,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nudibranch", } path = ClusterManagerClient.common_folder_path(**expected) @@ -28541,7 +28567,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "cuttlefish" expected = "organizations/{organization}".format( organization=organization, ) @@ -28551,7 +28577,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "mussel", } path = ClusterManagerClient.common_organization_path(**expected) @@ -28561,7 +28587,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "winkle" expected = "projects/{project}".format( project=project, ) @@ -28571,7 +28597,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "nautilus", } path = ClusterManagerClient.common_project_path(**expected) @@ -28581,8 +28607,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "scallop" + location = "abalone" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -28593,8 +28619,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "squid", + "location": "clam", } path = ClusterManagerClient.common_location_path(**expected) diff --git a/packages/google-cloud-container/tests/unit/gapic/container_v1beta1/test_cluster_manager.py b/packages/google-cloud-container/tests/unit/gapic/container_v1beta1/test_cluster_manager.py index a7d826dbb140..af7274b576b4 100644 --- a/packages/google-cloud-container/tests/unit/gapic/container_v1beta1/test_cluster_manager.py +++ b/packages/google-cloud-container/tests/unit/gapic/container_v1beta1/test_cluster_manager.py @@ -1667,6 +1667,7 @@ def test_get_cluster(request_type, transport: str = "grpc"): endpoint="endpoint_value", initial_cluster_version="initial_cluster_version_value", current_master_version="current_master_version_value", + current_emulated_version="current_emulated_version_value", current_node_version="current_node_version_value", create_time="create_time_value", status=cluster_service.Cluster.Status.PROVISIONING, @@ -1713,6 +1714,7 @@ def test_get_cluster(request_type, transport: str = "grpc"): assert response.endpoint == "endpoint_value" assert response.initial_cluster_version == "initial_cluster_version_value" assert response.current_master_version == "current_master_version_value" + assert response.current_emulated_version == "current_emulated_version_value" assert response.current_node_version == "current_node_version_value" assert response.create_time == "create_time_value" assert response.status == cluster_service.Cluster.Status.PROVISIONING @@ -1879,6 +1881,7 @@ async def test_get_cluster_async( endpoint="endpoint_value", initial_cluster_version="initial_cluster_version_value", current_master_version="current_master_version_value", + current_emulated_version="current_emulated_version_value", current_node_version="current_node_version_value", create_time="create_time_value", status=cluster_service.Cluster.Status.PROVISIONING, @@ -1926,6 +1929,7 @@ async def test_get_cluster_async( assert response.endpoint == "endpoint_value" assert response.initial_cluster_version == "initial_cluster_version_value" assert response.current_master_version == "current_master_version_value" + assert response.current_emulated_version == "current_emulated_version_value" assert response.current_node_version == "current_node_version_value" assert response.create_time == "create_time_value" assert response.status == cluster_service.Cluster.Status.PROVISIONING @@ -15309,6 +15313,305 @@ async def test_fetch_node_pool_upgrade_info_flattened_error_async(): ) +@pytest.mark.parametrize( + "request_type", + [ + cluster_service.CompleteControlPlaneUpgradeRequest, + dict, + ], +) +def test_complete_control_plane_upgrade(request_type, transport: str = "grpc"): + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = cluster_service.Operation( + name="name_value", + zone="zone_value", + operation_type=cluster_service.Operation.Type.CREATE_CLUSTER, + status=cluster_service.Operation.Status.PENDING, + detail="detail_value", + status_message="status_message_value", + self_link="self_link_value", + target_link="target_link_value", + location="location_value", + start_time="start_time_value", + end_time="end_time_value", + ) + response = client.complete_control_plane_upgrade(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + request = cluster_service.CompleteControlPlaneUpgradeRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, cluster_service.Operation) + assert response.name == "name_value" + assert response.zone == "zone_value" + assert response.operation_type == cluster_service.Operation.Type.CREATE_CLUSTER + assert response.status == cluster_service.Operation.Status.PENDING + assert response.detail == "detail_value" + assert response.status_message == "status_message_value" + assert response.self_link == "self_link_value" + assert response.target_link == "target_link_value" + assert response.location == "location_value" + assert response.start_time == "start_time_value" + assert response.end_time == "end_time_value" + + +def test_complete_control_plane_upgrade_non_empty_request_with_auto_populated_field(): + # This test is a coverage failsafe to make sure that UUID4 fields are + # automatically populated, according to AIP-4235, with non-empty requests. + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Populate all string fields in the request which are not UUID4 + # since we want to check that UUID4 are populated automatically + # if they meet the requirements of AIP 4235. + request = cluster_service.CompleteControlPlaneUpgradeRequest( + name="name_value", + version="version_value", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + call.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client.complete_control_plane_upgrade(request=request) + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == cluster_service.CompleteControlPlaneUpgradeRequest( + name="name_value", + version="version_value", + ) + + +def test_complete_control_plane_upgrade_use_cached_wrapped_rpc(): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._transport.complete_control_plane_upgrade + in client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.Mock() + mock_rpc.return_value.name = ( + "foo" # operation_request.operation in compute client(s) expect a string. + ) + client._transport._wrapped_methods[ + client._transport.complete_control_plane_upgrade + ] = mock_rpc + request = {} + client.complete_control_plane_upgrade(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + client.complete_control_plane_upgrade(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_complete_control_plane_upgrade_async_use_cached_wrapped_rpc( + transport: str = "grpc_asyncio", +): + # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, + # instead of constructing them on each call + with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: + client = ClusterManagerAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Should wrap all calls on client creation + assert wrapper_fn.call_count > 0 + wrapper_fn.reset_mock() + + # Ensure method has been cached + assert ( + client._client._transport.complete_control_plane_upgrade + in client._client._transport._wrapped_methods + ) + + # Replace cached wrapped function with mock + mock_rpc = mock.AsyncMock() + mock_rpc.return_value = mock.Mock() + client._client._transport._wrapped_methods[ + client._client._transport.complete_control_plane_upgrade + ] = mock_rpc + + request = {} + await client.complete_control_plane_upgrade(request) + + # Establish that the underlying gRPC stub method was called. + assert mock_rpc.call_count == 1 + + await client.complete_control_plane_upgrade(request) + + # Establish that a new wrapper was not created for this call + assert wrapper_fn.call_count == 0 + assert mock_rpc.call_count == 2 + + +@pytest.mark.asyncio +async def test_complete_control_plane_upgrade_async( + transport: str = "grpc_asyncio", + request_type=cluster_service.CompleteControlPlaneUpgradeRequest, +): + client = ClusterManagerAsyncClient( + credentials=async_anonymous_credentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + cluster_service.Operation( + name="name_value", + zone="zone_value", + operation_type=cluster_service.Operation.Type.CREATE_CLUSTER, + status=cluster_service.Operation.Status.PENDING, + detail="detail_value", + status_message="status_message_value", + self_link="self_link_value", + target_link="target_link_value", + location="location_value", + start_time="start_time_value", + end_time="end_time_value", + ) + ) + response = await client.complete_control_plane_upgrade(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + request = cluster_service.CompleteControlPlaneUpgradeRequest() + assert args[0] == request + + # Establish that the response is the type that we expect. + assert isinstance(response, cluster_service.Operation) + assert response.name == "name_value" + assert response.zone == "zone_value" + assert response.operation_type == cluster_service.Operation.Type.CREATE_CLUSTER + assert response.status == cluster_service.Operation.Status.PENDING + assert response.detail == "detail_value" + assert response.status_message == "status_message_value" + assert response.self_link == "self_link_value" + assert response.target_link == "target_link_value" + assert response.location == "location_value" + assert response.start_time == "start_time_value" + assert response.end_time == "end_time_value" + + +@pytest.mark.asyncio +async def test_complete_control_plane_upgrade_async_from_dict(): + await test_complete_control_plane_upgrade_async(request_type=dict) + + +def test_complete_control_plane_upgrade_field_headers(): + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = cluster_service.CompleteControlPlaneUpgradeRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + call.return_value = cluster_service.Operation() + client.complete_control_plane_upgrade(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_complete_control_plane_upgrade_field_headers_async(): + client = ClusterManagerAsyncClient( + credentials=async_anonymous_credentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = cluster_service.CompleteControlPlaneUpgradeRequest() + + request.name = "name_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + cluster_service.Operation() + ) + await client.complete_control_plane_upgrade(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "name=name_value", + ) in kw["metadata"] + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.ClusterManagerGrpcTransport( @@ -16227,6 +16530,29 @@ def test_fetch_node_pool_upgrade_info_empty_call_grpc(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +def test_complete_control_plane_upgrade_empty_call_grpc(): + client = ClusterManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + call.return_value = cluster_service.Operation() + client.complete_control_plane_upgrade(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = cluster_service.CompleteControlPlaneUpgradeRequest() + + assert args[0] == request_msg + + def test_transport_kind_grpc_asyncio(): transport = ClusterManagerAsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() @@ -16301,6 +16627,7 @@ async def test_get_cluster_empty_call_grpc_asyncio(): endpoint="endpoint_value", initial_cluster_version="initial_cluster_version_value", current_master_version="current_master_version_value", + current_emulated_version="current_emulated_version_value", current_node_version="current_node_version_value", create_time="create_time_value", status=cluster_service.Cluster.Status.PROVISIONING, @@ -17559,6 +17886,45 @@ async def test_fetch_node_pool_upgrade_info_empty_call_grpc_asyncio(): assert args[0] == request_msg +# This test is a coverage failsafe to make sure that totally empty calls, +# i.e. request == None and no flattened fields passed, work. +@pytest.mark.asyncio +async def test_complete_control_plane_upgrade_empty_call_grpc_asyncio(): + client = ClusterManagerAsyncClient( + credentials=async_anonymous_credentials(), + transport="grpc_asyncio", + ) + + # Mock the actual call, and fake the request. + with mock.patch.object( + type(client.transport.complete_control_plane_upgrade), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + cluster_service.Operation( + name="name_value", + zone="zone_value", + operation_type=cluster_service.Operation.Type.CREATE_CLUSTER, + status=cluster_service.Operation.Status.PENDING, + detail="detail_value", + status_message="status_message_value", + self_link="self_link_value", + target_link="target_link_value", + location="location_value", + start_time="start_time_value", + end_time="end_time_value", + ) + ) + await client.complete_control_plane_upgrade(request=None) + + # Establish that the underlying stub method was called. + call.assert_called() + _, args, _ = call.mock_calls[0] + request_msg = cluster_service.CompleteControlPlaneUpgradeRequest() + + assert args[0] == request_msg + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = ClusterManagerClient( @@ -17629,6 +17995,7 @@ def test_cluster_manager_base_transport(): "list_locations", "fetch_cluster_upgrade_info", "fetch_node_pool_upgrade_info", + "complete_control_plane_upgrade", ) for method in methods: with pytest.raises(NotImplementedError): @@ -18035,9 +18402,35 @@ def test_parse_crypto_key_version_path(): assert expected == actual -def test_topic_path(): +def test_subnetwork_path(): project = "oyster" - topic = "nudibranch" + region = "nudibranch" + subnetwork = "cuttlefish" + expected = "projects/{project}/regions/{region}/subnetworks/{subnetwork}".format( + project=project, + region=region, + subnetwork=subnetwork, + ) + actual = ClusterManagerClient.subnetwork_path(project, region, subnetwork) + assert expected == actual + + +def test_parse_subnetwork_path(): + expected = { + "project": "mussel", + "region": "winkle", + "subnetwork": "nautilus", + } + path = ClusterManagerClient.subnetwork_path(**expected) + + # Check that the path construction is reversible. + actual = ClusterManagerClient.parse_subnetwork_path(path) + assert expected == actual + + +def test_topic_path(): + project = "scallop" + topic = "abalone" expected = "projects/{project}/topics/{topic}".format( project=project, topic=topic, @@ -18048,8 +18441,8 @@ def test_topic_path(): def test_parse_topic_path(): expected = { - "project": "cuttlefish", - "topic": "mussel", + "project": "squid", + "topic": "clam", } path = ClusterManagerClient.topic_path(**expected) @@ -18059,7 +18452,7 @@ def test_parse_topic_path(): def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "whelk" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -18069,7 +18462,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "octopus", } path = ClusterManagerClient.common_billing_account_path(**expected) @@ -18079,7 +18472,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "oyster" expected = "folders/{folder}".format( folder=folder, ) @@ -18089,7 +18482,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nudibranch", } path = ClusterManagerClient.common_folder_path(**expected) @@ -18099,7 +18492,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "cuttlefish" expected = "organizations/{organization}".format( organization=organization, ) @@ -18109,7 +18502,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "mussel", } path = ClusterManagerClient.common_organization_path(**expected) @@ -18119,7 +18512,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "winkle" expected = "projects/{project}".format( project=project, ) @@ -18129,7 +18522,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "nautilus", } path = ClusterManagerClient.common_project_path(**expected) @@ -18139,8 +18532,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "scallop" + location = "abalone" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -18151,8 +18544,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "squid", + "location": "clam", } path = ClusterManagerClient.common_location_path(**expected) diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py b/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py index eeb2b7a29522..f5345ee48c7c 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1/types/document.py @@ -120,10 +120,10 @@ class Document(proto.Message): comparing the entity extraction results at different stages of the processing. entities_revision_id (str): - The entity revision id that ``document.entities`` field is + The entity revision ID that ``document.entities`` field is based on. If this field is set and ``entities_revisions`` is not empty, the entities in ``document.entities`` field are - the entities in the entity revision with this id and + the entities in the entity revision with this ID and ``document.entity_validation_output`` field is the ``entity_validation_output`` field in this entity revision. """ diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py index e47bd867613d..63069e997415 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document.py @@ -114,9 +114,9 @@ class Document(proto.Message): blob_assets (MutableSequence[google.cloud.documentai_v1beta3.types.Document.BlobAsset]): Optional. The blob assets in this document. This is used to store the content of the inline - blobs in this document, e.g. image bytes, such - that it can be referenced by other fields in the - document via asset id. + blobs in this document, for example, image + bytes, such that it can be referenced by other + fields in the document via asset id. entity_validation_output (google.cloud.documentai_v1beta3.types.Document.EntityValidationOutput): The entity validation output for the document. This is the validation output for ``document.entities`` field. @@ -127,10 +127,10 @@ class Document(proto.Message): comparing the entity extraction results at different stages of the processing. entities_revision_id (str): - The entity revision id that ``document.entities`` field is + The entity revision ID that ``document.entities`` field is based on. If this field is set and ``entities_revisions`` is not empty, the entities in ``document.entities`` field are - the entities in the entity revision with this id and + the entities in the entity revision with this ID and ``document.entity_validation_output`` field is the ``entity_validation_output`` field in this entity revision. """ @@ -299,7 +299,8 @@ class Page(proto.Message): page. visual_elements (MutableSequence[google.cloud.documentai_v1beta3.types.Document.Page.VisualElement]): A list of detected non-text visual elements - e.g. checkbox, signature etc. on the page. + for example, checkbox, signature etc. on the + page. tables (MutableSequence[google.cloud.documentai_v1beta3.types.Document.Page.Table]): A list of visually detected tables on the page. @@ -421,9 +422,9 @@ class Layout(proto.Message): confidence (float): Confidence of the current [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] - within context of the object this layout is for. e.g. - confidence can be for a single token, a table, a visual - element, etc. depending on context. Range ``[0, 1]``. + within context of the object this layout is for. For + example, confidence can be for a single token, a table, a + visual element, etc. depending on context. Range ``[0, 1]``. bounding_poly (google.cloud.documentai_v1beta3.types.BoundingPoly): The bounding polygon for the [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout]. @@ -799,8 +800,8 @@ class Symbol(proto.Message): ) class VisualElement(proto.Message): - r"""Detected non-text visual elements e.g. checkbox, signature - etc. on the page. + r"""Detected non-text visual elements, for example, checkbox, + signature, etc. on the page. Attributes: layout (google.cloud.documentai_v1beta3.types.Document.Page.Layout): @@ -945,7 +946,7 @@ class FormField(proto.Message): [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] for the [FormField][google.cloud.documentai.v1beta3.Document.Page.FormField] - name. e.g. ``Address``, ``Email``, ``Grand total``, + name. For example, ``Address``, ``Email``, ``Grand total``, ``Phone number``, etc. field_value (google.cloud.documentai_v1beta3.types.Document.Page.Layout): [Layout][google.cloud.documentai.v1beta3.Document.Page.Layout] @@ -1220,9 +1221,10 @@ class Entity(proto.Message): into the [Document.text][google.cloud.documentai.v1beta3.Document.text]. type_ (str): - Required. Entity type from a schema e.g. ``Address``. + Required. Entity type from a schema for example, + ``Address``. mention_text (str): - Optional. Text value of the entity e.g. + Optional. Text value of the entity for example, ``1600 Amphitheatre Pkwy``. mention_id (str): Optional. Deprecated. Use ``id`` field instead. @@ -1234,13 +1236,13 @@ class Entity(proto.Message): entity wrt. the location on the page where it was found. id (str): - Optional. Canonical id. This will be a unique + Optional. Canonical ID. This will be a unique value in the entity list for this document. normalized_value (google.cloud.documentai_v1beta3.types.Document.Entity.NormalizedValue): Optional. Normalized entity value. Absent if the extracted value could not be converted or - the type (e.g. address) is not supported for - certain parsers. This field is also only + the type (for example, address) is not supported + for certain parsers. This field is also only populated for certain supported document types. properties (MutableSequence[google.cloud.documentai_v1beta3.types.Document.Entity]): Optional. Entities can be nested to form a @@ -1454,9 +1456,9 @@ class EntityRelation(proto.Message): Attributes: subject_id (str): - Subject entity id. + Subject entity ID. object_id (str): - Object entity id. + Object entity ID. relation (str): Relationship description. """ @@ -1651,7 +1653,7 @@ class Provenance(proto.Message): The index of the revision that produced this element. id (int): - The Id of this operation. Needs to be unique + The ID of this operation. Needs to be unique within the scope of the revision. parents (MutableSequence[google.cloud.documentai_v1beta3.types.Document.Provenance.Parent]): References to the original elements that are @@ -1716,7 +1718,7 @@ class Parent(proto.Message): properties within entities, etc.) in the parent revision. id (int): - The id of the parent provenance. + The ID of the parent provenance. """ revision: int = proto.Field( @@ -1764,7 +1766,7 @@ class Revision(proto.Message): Attributes: agent (str): If the change was made by a person specify - the name or id of that person. + the name or ID of that person. This field is a member of `oneof`_ ``source``. processor (str): @@ -1773,7 +1775,7 @@ class Revision(proto.Message): This field is a member of `oneof`_ ``source``. id (str): - Id of the revision, internally generated by + ID of the revision, internally generated by doc proto storage. Unique within the context of the document. parent (MutableSequence[int]): @@ -1782,7 +1784,7 @@ class Revision(proto.Message): field represents the index into the ``revisions`` field. parent_ids (MutableSequence[str]): The revisions that this revision is based on. Must include - all the ids that have anything to do with this revision - + all the IDs that have anything to do with this revision - eg. there are ``provenance.parent.revision`` fields that index into this field. create_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1798,8 +1800,8 @@ class HumanReview(proto.Message): Attributes: state (str): - Human review state. e.g. ``requested``, ``succeeded``, - ``rejected``. + Human review state. For example, ``requested``, + ``succeeded``, ``rejected``. state_message (str): A message providing more details about the current state of processing. For example, the rejection reason when the state @@ -2135,20 +2137,20 @@ class LayoutImageBlock(proto.Message): Attributes: blob_asset_id (str): - Optional. Asset id of the inline image. If set, find the + Optional. Asset ID of the inline image. If set, find the image content in the blob_assets field. This field is a member of `oneof`_ ``image_source``. gcs_uri (str): - Optional. Google Cloud Storage uri of the + Optional. Google Cloud Storage URI of the image. This field is a member of `oneof`_ ``image_source``. data_uri (str): - Optional. Data uri of the image. It is composed of four + Optional. Data URI of the image. It is composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data - itself: data:[][;base64], + itself: data:[][;base64],. This field is a member of `oneof`_ ``image_source``. mime_type (str): @@ -2337,20 +2339,20 @@ class ImageChunkField(proto.Message): Attributes: blob_asset_id (str): - Optional. Asset id of the inline image. If set, find the + Optional. Asset ID of the inline image. If set, find the image content in the blob_assets field. This field is a member of `oneof`_ ``image_source``. gcs_uri (str): - Optional. Google Cloud Storage uri of the + Optional. Google Cloud Storage URI of the image. This field is a member of `oneof`_ ``image_source``. data_uri (str): - Optional. Data uri of the image. It is composed of four + Optional. Data URI of the image. It is composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data - itself: data:[][;base64], + itself: data:[][;base64],. This field is a member of `oneof`_ ``image_source``. annotations (google.cloud.documentai_v1beta3.types.Document.Annotations): @@ -2394,7 +2396,7 @@ class TableChunkField(proto.Message): class ChunkField(proto.Message): r"""The chunk field in the chunk. A chunk field could be one of - the various types (e.g. image, table) supported. + the various types (for example, image, table) supported. This message has `oneof`_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. @@ -2478,15 +2480,16 @@ class ChunkField(proto.Message): class BlobAsset(proto.Message): r"""Represents a blob asset. It's used to store the content of - the inline blob in this document, e.g. image bytes, such that it - can be referenced by other fields in the document via asset id. + the inline blob in this document, for example, image bytes, such + that it can be referenced by other fields in the document via + asset ID. Attributes: asset_id (str): - Optional. The id of the blob asset. + Optional. The ID of the blob asset. content (bytes): - Optional. The content of the blob asset, e.g. - image bytes. + Optional. The content of the blob asset, for + example, image bytes. mime_type (str): The mime type of the blob asset. An IANA published `media type (MIME @@ -2590,7 +2593,7 @@ class EntitiesRevision(proto.Message): Attributes: revision_id (str): - The revision id. + The revision ID. entities (MutableSequence[google.cloud.documentai_v1beta3.types.Document.Entity]): The entities in this revision. entity_validation_output (google.cloud.documentai_v1beta3.types.Document.EntityValidationOutput): @@ -2723,7 +2726,7 @@ class RevisionRef(proto.Message): This field is a member of `oneof`_ ``source``. revision_id (str): - Reads the revision given by the id. + Reads the revision given by the ID. This field is a member of `oneof`_ ``source``. latest_processor_version (str): diff --git a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_processor_service.py b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_processor_service.py index 636baa2c9bac..04f29c6520e1 100644 --- a/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_processor_service.py +++ b/packages/google-cloud-documentai/google/cloud/documentai_v1beta3/types/document_processor_service.py @@ -169,15 +169,14 @@ class ChunkingConfig(proto.Message): Optional. Whether or not to include ancestor headings when splitting. semantic_chunking_group_size (bool): - Optional. The number of tokens to group - together when evaluating semantic similarity. - THIS FIELD IS NOT YET USED. + Optional. The number of tokens to group together when + evaluating semantic similarity. **Note:** This field is not + yet used. breakpoint_percentile_threshold (int): - Optional. The percentile of cosine - dissimilarity that must be exceeded between a - group of tokens and the next. The smaller this - number is, the more chunks will be generated. - THIS FIELD IS NOT YET USED. + Optional. The percentile of cosine dissimilarity that must + be exceeded between a group of tokens and the next. The + smaller this number is, the more chunks will be generated. + **Note:** This field is not yet used. """ chunk_size: int = proto.Field( diff --git a/packages/google-cloud-network-management/google/cloud/network_management/__init__.py b/packages/google-cloud-network-management/google/cloud/network_management/__init__.py index dd26414a5111..01e0615d027c 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management/__init__.py +++ b/packages/google-cloud-network-management/google/cloud/network_management/__init__.py @@ -68,10 +68,12 @@ ForwardInfo, ForwardingRuleInfo, GKEMasterInfo, + GkePodInfo, GoogleServiceInfo, HybridSubnetInfo, InstanceInfo, InterconnectAttachmentInfo, + IpMasqueradingSkippedInfo, LoadBalancerBackend, LoadBalancerBackendInfo, LoadBalancerInfo, @@ -142,10 +144,12 @@ "ForwardInfo", "ForwardingRuleInfo", "GKEMasterInfo", + "GkePodInfo", "GoogleServiceInfo", "HybridSubnetInfo", "InstanceInfo", "InterconnectAttachmentInfo", + "IpMasqueradingSkippedInfo", "LoadBalancerBackend", "LoadBalancerBackendInfo", "LoadBalancerInfo", diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/__init__.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/__init__.py index 3ea3bca402f5..6a683df7470e 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/__init__.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/__init__.py @@ -72,10 +72,12 @@ ForwardInfo, ForwardingRuleInfo, GKEMasterInfo, + GkePodInfo, GoogleServiceInfo, HybridSubnetInfo, InstanceInfo, InterconnectAttachmentInfo, + IpMasqueradingSkippedInfo, LoadBalancerBackend, LoadBalancerBackendInfo, LoadBalancerInfo, @@ -229,10 +231,12 @@ def _get_version(dependency_name): "GKEMasterInfo", "GetConnectivityTestRequest", "GetVpcFlowLogsConfigRequest", + "GkePodInfo", "GoogleServiceInfo", "HybridSubnetInfo", "InstanceInfo", "InterconnectAttachmentInfo", + "IpMasqueradingSkippedInfo", "LatencyDistribution", "LatencyPercentile", "ListConnectivityTestsRequest", diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/async_client.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/async_client.py index a1762149c616..bd921d499f78 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/async_client.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/async_client.py @@ -373,7 +373,7 @@ async def sample_list_vpc_flow_logs_configs(): Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats: - - For project-level resourcs: + - For project-level resources: ``projects/{project_id}/locations/global`` - For organization-level resources: diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/client.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/client.py index 7c3791e5880a..0a530a9d0470 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/client.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/client.py @@ -821,7 +821,7 @@ def sample_list_vpc_flow_logs_configs(): Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats: - - For project-level resourcs: + - For project-level resources: ``projects/{project_id}/locations/global`` - For organization-level resources: diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest.py index 5749da14192e..75677e1a177a 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest.py @@ -704,7 +704,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "post", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}:cancel", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}:cancel", "body": "*", }, ], @@ -715,7 +715,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "delete", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ], "google.longrunning.Operations.GetOperation": [ @@ -725,7 +725,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ], "google.longrunning.Operations.ListOperations": [ @@ -735,7 +735,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*}/operations", + "uri": "/v1/{name=organizations/*/locations/global}/operations", }, ], } diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest_base.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest_base.py index 3ebe0ab2362a..a5b70cc0dd95 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest_base.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/organization_vpc_flow_logs_service/transports/rest_base.py @@ -511,7 +511,7 @@ def _get_http_options(): }, { "method": "post", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}:cancel", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}:cancel", "body": "*", }, ] @@ -546,7 +546,7 @@ def _get_http_options(): }, { "method": "delete", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ] return http_options @@ -575,7 +575,7 @@ def _get_http_options(): }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ] return http_options @@ -604,7 +604,7 @@ def _get_http_options(): }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*}/operations", + "uri": "/v1/{name=organizations/*/locations/global}/operations", }, ] return http_options diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest.py index 75404206e40d..309dce5180f3 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest.py @@ -762,7 +762,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "post", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}:cancel", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}:cancel", "body": "*", }, ], @@ -773,7 +773,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "delete", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ], "google.longrunning.Operations.GetOperation": [ @@ -783,7 +783,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ], "google.longrunning.Operations.ListOperations": [ @@ -793,7 +793,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*}/operations", + "uri": "/v1/{name=organizations/*/locations/global}/operations", }, ], } diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest_base.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest_base.py index 1ea3326be1c8..a804159f01ab 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest_base.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/reachability_service/transports/rest_base.py @@ -566,7 +566,7 @@ def _get_http_options(): }, { "method": "post", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}:cancel", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}:cancel", "body": "*", }, ] @@ -601,7 +601,7 @@ def _get_http_options(): }, { "method": "delete", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ] return http_options @@ -630,7 +630,7 @@ def _get_http_options(): }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ] return http_options @@ -659,7 +659,7 @@ def _get_http_options(): }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*}/operations", + "uri": "/v1/{name=organizations/*/locations/global}/operations", }, ] return http_options diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/async_client.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/async_client.py index 61e20f1ae8bf..10eac965a289 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/async_client.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/async_client.py @@ -360,7 +360,7 @@ async def sample_list_vpc_flow_logs_configs(): Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats: - - For project-level resourcs: + - For project-level resources: ``projects/{project_id}/locations/global`` - For organization-level resources: diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/client.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/client.py index 3551c703c0b5..045ae5cb6941 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/client.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/client.py @@ -798,7 +798,7 @@ def sample_list_vpc_flow_logs_configs(): Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats: - - For project-level resourcs: + - For project-level resources: ``projects/{project_id}/locations/global`` - For organization-level resources: diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest.py index 140d14e2c7e3..d0cc56cc0885 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest.py @@ -820,7 +820,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "post", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}:cancel", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}:cancel", "body": "*", }, ], @@ -831,7 +831,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "delete", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ], "google.longrunning.Operations.GetOperation": [ @@ -841,7 +841,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ], "google.longrunning.Operations.ListOperations": [ @@ -851,7 +851,7 @@ def operations_client(self) -> operations_v1.AbstractOperationsClient: }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*}/operations", + "uri": "/v1/{name=organizations/*/locations/global}/operations", }, ], } diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest_base.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest_base.py index d72408b47fae..444ae7b9b828 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest_base.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/services/vpc_flow_logs_service/transports/rest_base.py @@ -605,7 +605,7 @@ def _get_http_options(): }, { "method": "post", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}:cancel", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}:cancel", "body": "*", }, ] @@ -640,7 +640,7 @@ def _get_http_options(): }, { "method": "delete", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ] return http_options @@ -669,7 +669,7 @@ def _get_http_options(): }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*/operations/*}", + "uri": "/v1/{name=organizations/*/locations/global/operations/*}", }, ] return http_options @@ -698,7 +698,7 @@ def _get_http_options(): }, { "method": "get", - "uri": "/v1/{name=organizations/*/locations/*}/operations", + "uri": "/v1/{name=organizations/*/locations/global}/operations", }, ] return http_options diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/__init__.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/__init__.py index cb0c83f545d3..969ad5cb0aae 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/__init__.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/__init__.py @@ -45,10 +45,12 @@ ForwardInfo, ForwardingRuleInfo, GKEMasterInfo, + GkePodInfo, GoogleServiceInfo, HybridSubnetInfo, InstanceInfo, InterconnectAttachmentInfo, + IpMasqueradingSkippedInfo, LoadBalancerBackend, LoadBalancerBackendInfo, LoadBalancerInfo, @@ -110,10 +112,12 @@ "ForwardInfo", "ForwardingRuleInfo", "GKEMasterInfo", + "GkePodInfo", "GoogleServiceInfo", "HybridSubnetInfo", "InstanceInfo", "InterconnectAttachmentInfo", + "IpMasqueradingSkippedInfo", "LoadBalancerBackend", "LoadBalancerBackendInfo", "LoadBalancerInfo", diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/connectivity_test.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/connectivity_test.py index a343b8b88a42..90bd907285bf 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/connectivity_test.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/connectivity_test.py @@ -243,6 +243,10 @@ class Endpoint(proto.Message): A `Redis Cluster `__ URI. Applicable only to destination endpoint. + gke_pod (str): + A `GKE + Pod `__ + URI. cloud_function (google.cloud.network_management_v1.types.Endpoint.CloudFunctionEndpoint): A `Cloud Function `__. Applicable only to source endpoint. @@ -256,48 +260,59 @@ class Endpoint(proto.Message): `revision `__ Applicable only to source endpoint. network (str): - A VPC network URI. + A VPC network URI. For source endpoints, used according to + the ``network_type``. For destination endpoints, used only + when the source is an external IP address endpoint, and the + destination is an internal IP address endpoint. network_type (google.cloud.network_management_v1.types.Endpoint.NetworkType): - Type of the network where the endpoint is - located. Applicable only to source endpoint, as - destination network type can be inferred from - the source. + For source endpoints, type of the network + where the endpoint is located. Not relevant for + destination endpoints. project_id (str): - Project ID where the endpoint is located. - The project ID can be derived from the URI if - you provide a endpoint or network URI. - The following are two cases where you may need - to provide the project ID: - - 1. Only the IP address is specified, and the IP - address is within a Google Cloud project. - 2. When you are using Shared VPC and the IP - address that you provide is from the service - project. In this case, the network that the - IP address resides in is defined in the host - project. + For source endpoints, endpoint project ID. Used according to + the ``network_type``. Not relevant for destination + endpoints. """ class NetworkType(proto.Enum): - r"""The type definition of an endpoint's network. Use one of the - following choices: + r"""The type of the network of the IP address endpoint. Relevant + for the source IP address endpoints. Values: NETWORK_TYPE_UNSPECIFIED (0): - Default type if unspecified. + Unspecified. The test will analyze all possible IP address + locations. This might take longer and produce inaccurate or + ambiguous results, so prefer specifying an explicit network + type. + + The ``project_id`` field should be set to the project where + the GCP endpoint is located, or where the non-GCP endpoint + should be reachable from (via routes to non-GCP networks). + The project might also be inferred from the Connectivity + Test project or other projects referenced in the request. GCP_NETWORK (1): - A network hosted within Google Cloud. - To receive more detailed output, specify the URI - for the source or destination network. + A VPC network. Should be used for internal IP addresses in + VPC networks. The ``network`` field should be set to the URI + of this network. Only endpoints within this network will be + considered. NON_GCP_NETWORK (2): - A network hosted outside of Google Cloud. - This can be an on-premises network, an internet - resource or a network hosted by another cloud - provider. + A non-GCP network (for example, an on-premises network or + another cloud provider network). Should be used for internal + IP addresses outside of Google Cloud. The ``network`` field + should be set to the URI of the VPC network containing a + corresponding Cloud VPN tunnel, Cloud Interconnect VLAN + attachment, or a router appliance instance. Only endpoints + reachable from the provided VPC network via the routes to + non-GCP networks will be considered. + INTERNET (3): + Internet. Should be used for + internet-routable external IP addresses or IP + addresses for global Google APIs and services. """ NETWORK_TYPE_UNSPECIFIED = 0 GCP_NETWORK = 1 NON_GCP_NETWORK = 2 + INTERNET = 3 class ForwardingRuleTarget(proto.Enum): r"""Type of the target of a forwarding rule. @@ -432,6 +447,10 @@ class CloudRunRevisionEndpoint(proto.Message): proto.STRING, number=18, ) + gke_pod: str = proto.Field( + proto.STRING, + number=21, + ) cloud_function: CloudFunctionEndpoint = proto.Field( proto.MESSAGE, number=10, diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/trace.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/trace.py index feca905f13a2..68fd92694eab 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/trace.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/trace.py @@ -43,6 +43,8 @@ "AbortInfo", "DropInfo", "GKEMasterInfo", + "GkePodInfo", + "IpMasqueradingSkippedInfo", "CloudSQLInstanceInfo", "RedisInstanceInfo", "RedisClusterInfo", @@ -286,6 +288,16 @@ class Step(proto.Message): Display information of a Google Kubernetes Engine cluster master. + This field is a member of `oneof`_ ``step_info``. + gke_pod (google.cloud.network_management_v1.types.GkePodInfo): + Display information of a Google Kubernetes + Engine Pod. + + This field is a member of `oneof`_ ``step_info``. + ip_masquerading_skipped (google.cloud.network_management_v1.types.IpMasqueradingSkippedInfo): + Display information of the reason why GKE Pod + IP masquerading was skipped. + This field is a member of `oneof`_ ``step_info``. cloud_sql_instance (google.cloud.network_management_v1.types.CloudSQLInstanceInfo): Display information of a Cloud SQL instance. @@ -370,6 +382,10 @@ class State(proto.Enum): Initial state: packet originating from a Cloud SQL instance. A CloudSQLInstanceInfo is populated with starting instance information. + START_FROM_GKE_POD (39): + Initial state: packet originating from a + Google Kubernetes Engine Pod. A GkePodInfo is + populated with starting Pod information. START_FROM_REDIS_INSTANCE (32): Initial state: packet originating from a Redis instance. A RedisInstanceInfo is populated @@ -454,6 +470,10 @@ class State(proto.Enum): NAT (14): Transition state: packet header translated. The ``nat`` field is populated with the translation information. + SKIP_GKE_POD_IP_MASQUERADING (40): + Transition state: GKE Pod IP masquerading is skipped. The + ``ip_masquerading_skipped`` field is populated with the + reason. PROXY_CONNECTION (15): Transition state: original connection is terminated and a new proxied connection is @@ -479,6 +499,7 @@ class State(proto.Enum): START_FROM_PRIVATE_NETWORK = 3 START_FROM_GKE_MASTER = 21 START_FROM_CLOUD_SQL_INSTANCE = 22 + START_FROM_GKE_POD = 39 START_FROM_REDIS_INSTANCE = 32 START_FROM_REDIS_CLUSTER = 33 START_FROM_CLOUD_FUNCTION = 23 @@ -504,6 +525,7 @@ class State(proto.Enum): DIRECT_VPC_EGRESS_CONNECTION = 35 SERVERLESS_EXTERNAL_CONNECTION = 36 NAT = 14 + SKIP_GKE_POD_IP_MASQUERADING = 40 PROXY_CONNECTION = 15 DELIVER = 16 DROP = 17 @@ -648,6 +670,18 @@ class State(proto.Enum): oneof="step_info", message="GKEMasterInfo", ) + gke_pod: "GkePodInfo" = proto.Field( + proto.MESSAGE, + number=37, + oneof="step_info", + message="GkePodInfo", + ) + ip_masquerading_skipped: "IpMasqueradingSkippedInfo" = proto.Field( + proto.MESSAGE, + number=38, + oneof="step_info", + message="IpMasqueradingSkippedInfo", + ) cloud_sql_instance: "CloudSQLInstanceInfo" = proto.Field( proto.MESSAGE, number=19, @@ -927,13 +961,19 @@ class FirewallRuleType(proto.Enum): implicit rules `__. NETWORK_FIREWALL_POLICY_RULE (5): - Global network firewall policy rule. For details, see - `Network firewall + User-defined global network firewall policy rule. For + details, see `Network firewall policies `__. NETWORK_REGIONAL_FIREWALL_POLICY_RULE (6): - Regional network firewall policy rule. For details, see - `Regional network firewall + User-defined regional network firewall policy rule. For + details, see `Regional network firewall policies `__. + SYSTEM_NETWORK_FIREWALL_POLICY_RULE (7): + System-defined global network firewall policy + rule. + SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE (8): + System-defined regional network firewall + policy rule. UNSUPPORTED_FIREWALL_POLICY_RULE (100): Firewall policy rule containing attributes not yet supported in Connectivity tests. Firewall analysis is skipped if such @@ -957,6 +997,8 @@ class FirewallRuleType(proto.Enum): SERVERLESS_VPC_ACCESS_MANAGED_FIREWALL_RULE = 4 NETWORK_FIREWALL_POLICY_RULE = 5 NETWORK_REGIONAL_FIREWALL_POLICY_RULE = 6 + SYSTEM_NETWORK_FIREWALL_POLICY_RULE = 7 + SYSTEM_REGIONAL_NETWORK_FIREWALL_POLICY_RULE = 8 UNSUPPORTED_FIREWALL_POLICY_RULE = 100 TRACKING_STATE = 101 ANALYSIS_SKIPPED = 102 @@ -2039,6 +2081,8 @@ class Target(proto.Enum): Target is a Redis Instance. REDIS_CLUSTER (17): Target is a Redis Cluster. + GKE_POD (19): + Target is a GKE Pod. """ TARGET_UNSPECIFIED = 0 INSTANCE = 1 @@ -2058,6 +2102,7 @@ class Target(proto.Enum): GOOGLE_MANAGED_SERVICE = 15 REDIS_INSTANCE = 16 REDIS_CLUSTER = 17 + GKE_POD = 19 class GoogleServiceType(proto.Enum): r"""Recognized type of a Google Service. @@ -2277,8 +2322,20 @@ class Cause(proto.Enum): test. NO_SOURCE_LOCATION (5): Aborted because no valid source or - destination endpoint is derived from the input + destination endpoint can be derived from the test request. + NO_SOURCE_GCP_NETWORK_LOCATION (42): + Aborted because the source IP address is not + contained within the subnet ranges of the + provided VPC network. + NO_SOURCE_NON_GCP_NETWORK_LOCATION (43): + Aborted because the source IP address is not + contained within the destination ranges of the + routes towards non-GCP networks in the provided + VPC network. + NO_SOURCE_INTERNET_LOCATION (44): + Aborted because the source IP address can't + be resolved as an Internet IP address. INVALID_ARGUMENT (6): Aborted because the source or destination endpoint specified in the request is invalid. @@ -2334,6 +2391,11 @@ class Cause(proto.Enum): SOURCE_PSC_CLOUD_SQL_UNSUPPORTED (20): Aborted because tests with a PSC-based Cloud SQL instance as a source are not supported. + SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED (45): + Aborted because tests with the external + database as a source are not supported. In such + replication scenarios, the connection is + initiated by the Cloud SQL replica instance. SOURCE_REDIS_CLUSTER_UNSUPPORTED (34): Aborted because tests with a Redis Cluster as a source are not supported. @@ -2361,6 +2423,11 @@ class Cause(proto.Enum): IP_VERSION_PROTOCOL_MISMATCH (40): Aborted because the used protocol is not supported for the used IP version. + GKE_POD_UNKNOWN_ENDPOINT_LOCATION (41): + Aborted because selected GKE Pod endpoint + location is unknown. This is often the case for + "Pending" Pods, which don't have assigned IP + addresses yet. """ CAUSE_UNSPECIFIED = 0 UNKNOWN_NETWORK = 1 @@ -2379,6 +2446,9 @@ class Cause(proto.Enum): PERMISSION_DENIED_NO_NEG_ENDPOINT_CONFIGS = 29 PERMISSION_DENIED_NO_CLOUD_ROUTER_CONFIGS = 36 NO_SOURCE_LOCATION = 5 + NO_SOURCE_GCP_NETWORK_LOCATION = 42 + NO_SOURCE_NON_GCP_NETWORK_LOCATION = 43 + NO_SOURCE_INTERNET_LOCATION = 44 INVALID_ARGUMENT = 6 TRACE_TOO_LONG = 9 INTERNAL_ERROR = 10 @@ -2393,6 +2463,7 @@ class Cause(proto.Enum): GOOGLE_MANAGED_SERVICE_AMBIGUOUS_PSC_ENDPOINT = 19 GOOGLE_MANAGED_SERVICE_AMBIGUOUS_ENDPOINT = 39 SOURCE_PSC_CLOUD_SQL_UNSUPPORTED = 20 + SOURCE_EXTERNAL_CLOUD_SQL_UNSUPPORTED = 45 SOURCE_REDIS_CLUSTER_UNSUPPORTED = 34 SOURCE_REDIS_INSTANCE_UNSUPPORTED = 35 SOURCE_FORWARDING_RULE_UNSUPPORTED = 21 @@ -2401,6 +2472,7 @@ class Cause(proto.Enum): UNSUPPORTED_GOOGLE_MANAGED_PROJECT_CONFIG = 31 NO_SERVERLESS_IP_RANGES = 37 IP_VERSION_PROTOCOL_MISMATCH = 40 + GKE_POD_UNKNOWN_ENDPOINT_LOCATION = 41 cause: Cause = proto.Field( proto.ENUM, @@ -2495,8 +2567,11 @@ class Cause(proto.Enum): invalid (it's not a forwarding rule of the internal passthrough load balancer). NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS (44): - Packet is sent from the Internet or Google - service to the private IPv6 address. + Packet is sent from the Internet to the + private IPv6 address. + NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS (109): + Packet is sent from the Internet to the + private IPv4 address. NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS (98): Packet is sent from the external IPv6 source address of an instance to the private IPv6 @@ -2552,6 +2627,9 @@ class Cause(proto.Enum): GKE_CLUSTER_NOT_RUNNING (27): Packet sent from or to a GKE cluster that is not in running state. + GKE_POD_NOT_RUNNING (103): + Packet sent from or to a GKE Pod that is not + in running state. CLOUD_SQL_INSTANCE_NOT_RUNNING (28): Packet sent from or to a Cloud SQL instance that is not in running state. @@ -2794,6 +2872,10 @@ class Cause(proto.Enum): Packet with destination IP address within the reserved NAT64 range is dropped due to no matching NAT gateway in the subnet. + NO_CONFIGURED_PRIVATE_NAT64_RULE (107): + Packet is dropped due to matching a Private + NAT64 gateway with no rules for source IPv6 + addresses. LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH (96): Packet is dropped due to being sent to a backend of a passthrough load balancer that @@ -2826,6 +2908,9 @@ class Cause(proto.Enum): hybrid subnet is different from the region of the next hop of the route matched within this hybrid subnet. + HYBRID_SUBNET_NO_ROUTE (106): + Packet is dropped because no matching route + was found in the hybrid subnet. """ CAUSE_UNSPECIFIED = 0 UNKNOWN_EXTERNAL_ADDRESS = 1 @@ -2842,6 +2927,7 @@ class Cause(proto.Enum): ROUTE_NEXT_HOP_VPN_TUNNEL_NOT_ESTABLISHED = 52 ROUTE_NEXT_HOP_FORWARDING_RULE_TYPE_INVALID = 53 NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV6_ADDRESS = 44 + NO_ROUTE_FROM_INTERNET_TO_PRIVATE_IPV4_ADDRESS = 109 NO_ROUTE_FROM_EXTERNAL_IPV6_SOURCE_TO_PRIVATE_IPV6_ADDRESS = 98 VPN_TUNNEL_LOCAL_SELECTOR_MISMATCH = 45 VPN_TUNNEL_REMOTE_SELECTOR_MISMATCH = 46 @@ -2856,6 +2942,7 @@ class Cause(proto.Enum): INGRESS_FIREWALL_TAGS_UNSUPPORTED_BY_DIRECT_VPC_EGRESS = 85 INSTANCE_NOT_RUNNING = 14 GKE_CLUSTER_NOT_RUNNING = 27 + GKE_POD_NOT_RUNNING = 103 CLOUD_SQL_INSTANCE_NOT_RUNNING = 28 REDIS_INSTANCE_NOT_RUNNING = 68 REDIS_CLUSTER_NOT_RUNNING = 69 @@ -2918,6 +3005,7 @@ class Cause(proto.Enum): UNSUPPORTED_ROUTE_MATCHED_FOR_NAT64_DESTINATION = 88 TRAFFIC_FROM_HYBRID_ENDPOINT_TO_INTERNET_DISALLOWED = 89 NO_MATCHING_NAT64_GATEWAY = 90 + NO_CONFIGURED_PRIVATE_NAT64_RULE = 107 LOAD_BALANCER_BACKEND_IP_VERSION_MISMATCH = 96 NO_KNOWN_ROUTE_FROM_NCC_NETWORK_TO_DESTINATION = 97 CLOUD_NAT_PROTOCOL_UNSUPPORTED = 99 @@ -2926,6 +3014,7 @@ class Cause(proto.Enum): L2_INTERCONNECT_DESTINATION_IP_MISMATCH = 102 NCC_ROUTE_WITHIN_HYBRID_SUBNET_UNSUPPORTED = 104 HYBRID_SUBNET_REGION_MISMATCH = 105 + HYBRID_SUBNET_NO_ROUTE = 106 cause: Cause = proto.Field( proto.ENUM, @@ -2999,6 +3088,103 @@ class GKEMasterInfo(proto.Message): ) +class GkePodInfo(proto.Message): + r"""For display only. Metadata associated with a Google + Kubernetes Engine (GKE) Pod. + + Attributes: + pod_uri (str): + URI of a GKE Pod. For Pods in regional Clusters, the URI + format is: + ``projects/{project}/locations/{location}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`` + For Pods in zonal Clusters, the URI format is: + ``projects/{project}/zones/{zone}/clusters/{cluster}/k8s/namespaces/{namespace}/pods/{pod}`` + ip_address (str): + IP address of a GKE Pod. If the Pod is + dual-stack, this is the IP address relevant to + the trace. + network_uri (str): + URI of the network containing the GKE Pod. + """ + + pod_uri: str = proto.Field( + proto.STRING, + number=1, + ) + ip_address: str = proto.Field( + proto.STRING, + number=2, + ) + network_uri: str = proto.Field( + proto.STRING, + number=3, + ) + + +class IpMasqueradingSkippedInfo(proto.Message): + r"""For display only. Contains information about why IP + masquerading was skipped for the packet. + + Attributes: + reason (google.cloud.network_management_v1.types.IpMasqueradingSkippedInfo.Reason): + Reason why IP masquerading was not applied. + non_masquerade_range (str): + The matched non-masquerade IP range. Only set if reason is + DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE or + DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE. + """ + + class Reason(proto.Enum): + r"""Reason why IP masquerading was skipped. + + Values: + REASON_UNSPECIFIED (0): + Unused default value. + DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE (1): + Masquerading not applied because destination + IP is in one of configured non-masquerade + ranges. + DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE (2): + Masquerading not applied because destination + IP is in one of default non-masquerade ranges. + DESTINATION_ON_SAME_NODE (3): + Masquerading not applied because destination + is on the same Node. + DEFAULT_SNAT_DISABLED (4): + Masquerading not applied because + ip-masq-agent doesn't exist and default SNAT is + disabled. + NO_MASQUERADING_FOR_IPV6 (5): + Masquerading not applied because the packet's + IP version is IPv6. + POD_USES_NODE_NETWORK_NAMESPACE (6): + Masquerading not applied because the source + Pod uses the host Node's network namespace, + including the Node's IP address. + NO_MASQUERADING_FOR_RETURN_PACKET (7): + Masquerading not applied because the packet + is a return packet. + """ + REASON_UNSPECIFIED = 0 + DESTINATION_IP_IN_CONFIGURED_NON_MASQUERADE_RANGE = 1 + DESTINATION_IP_IN_DEFAULT_NON_MASQUERADE_RANGE = 2 + DESTINATION_ON_SAME_NODE = 3 + DEFAULT_SNAT_DISABLED = 4 + NO_MASQUERADING_FOR_IPV6 = 5 + POD_USES_NODE_NETWORK_NAMESPACE = 6 + NO_MASQUERADING_FOR_RETURN_PACKET = 7 + + reason: Reason = proto.Field( + proto.ENUM, + number=1, + enum=Reason, + ) + non_masquerade_range: str = proto.Field( + proto.STRING, + number=2, + ) + + class CloudSQLInstanceInfo(proto.Message): r"""For display only. Metadata associated with a Cloud SQL instance. @@ -3367,6 +3553,9 @@ class NatInfo(proto.Message): nat_gateway_name (str): The name of Cloud NAT Gateway. Only valid when type is CLOUD_NAT. + cloud_nat_gateway_type (google.cloud.network_management_v1.types.NatInfo.CloudNatGatewayType): + Type of Cloud NAT gateway. Only valid when ``type`` is + CLOUD_NAT. """ class Type(proto.Enum): @@ -3395,6 +3584,30 @@ class Type(proto.Enum): PRIVATE_SERVICE_CONNECT = 4 GKE_POD_IP_MASQUERADING = 5 + class CloudNatGatewayType(proto.Enum): + r"""Types of Cloud NAT gateway. + + Values: + CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED (0): + Type is unspecified. + PUBLIC_NAT44 (1): + Public NAT gateway. + PUBLIC_NAT64 (2): + Public NAT64 gateway. + PRIVATE_NAT_NCC (3): + Private NAT gateway for NCC. + PRIVATE_NAT_HYBRID (4): + Private NAT gateway for hybrid connectivity. + PRIVATE_NAT64 (5): + Private NAT64 gateway. + """ + CLOUD_NAT_GATEWAY_TYPE_UNSPECIFIED = 0 + PUBLIC_NAT44 = 1 + PUBLIC_NAT64 = 2 + PRIVATE_NAT_NCC = 3 + PRIVATE_NAT_HYBRID = 4 + PRIVATE_NAT64 = 5 + type_: Type = proto.Field( proto.ENUM, number=1, @@ -3448,6 +3661,11 @@ class Type(proto.Enum): proto.STRING, number=13, ) + cloud_nat_gateway_type: CloudNatGatewayType = proto.Field( + proto.ENUM, + number=14, + enum=CloudNatGatewayType, + ) class ProxyConnectionInfo(proto.Message): diff --git a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/vpc_flow_logs.py b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/vpc_flow_logs.py index 4b3746f0e842..77142ee28e61 100644 --- a/packages/google-cloud-network-management/google/cloud/network_management_v1/types/vpc_flow_logs.py +++ b/packages/google-cloud-network-management/google/cloud/network_management_v1/types/vpc_flow_logs.py @@ -49,7 +49,7 @@ class ListVpcFlowLogsConfigsRequest(proto.Message): Required. The parent resource of the VpcFlowLogsConfig, in one of the following formats: - - For project-level resourcs: + - For project-level resources: ``projects/{project_id}/locations/global`` - For organization-level resources: diff --git a/packages/google-cloud-network-management/tests/unit/gapic/network_management_v1/test_reachability_service.py b/packages/google-cloud-network-management/tests/unit/gapic/network_management_v1/test_reachability_service.py index 0adff29e269c..918186623677 100644 --- a/packages/google-cloud-network-management/tests/unit/gapic/network_management_v1/test_reachability_service.py +++ b/packages/google-cloud-network-management/tests/unit/gapic/network_management_v1/test_reachability_service.py @@ -5581,6 +5581,7 @@ def test_create_connectivity_test_rest_call_success(request_type): "cloud_sql_instance": "cloud_sql_instance_value", "redis_instance": "redis_instance_value", "redis_cluster": "redis_cluster_value", + "gke_pod": "gke_pod_value", "cloud_function": {"uri": "uri_value"}, "app_engine_version": {"uri": "uri_value"}, "cloud_run_revision": { @@ -5833,6 +5834,15 @@ def test_create_connectivity_test_rest_call_success(request_type): "external_ip": "external_ip_value", "dns_endpoint": "dns_endpoint_value", }, + "gke_pod": { + "pod_uri": "pod_uri_value", + "ip_address": "ip_address_value", + "network_uri": "network_uri_value", + }, + "ip_masquerading_skipped": { + "reason": 1, + "non_masquerade_range": "non_masquerade_range_value", + }, "cloud_sql_instance": { "display_name": "display_name_value", "uri": "uri_value", @@ -5889,6 +5899,7 @@ def test_create_connectivity_test_rest_call_success(request_type): "new_destination_port": 2159, "router_uri": "router_uri_value", "nat_gateway_name": "nat_gateway_name_value", + "cloud_nat_gateway_type": 1, }, "proxy_connection": { "protocol": "protocol_value", @@ -6168,6 +6179,7 @@ def test_update_connectivity_test_rest_call_success(request_type): "cloud_sql_instance": "cloud_sql_instance_value", "redis_instance": "redis_instance_value", "redis_cluster": "redis_cluster_value", + "gke_pod": "gke_pod_value", "cloud_function": {"uri": "uri_value"}, "app_engine_version": {"uri": "uri_value"}, "cloud_run_revision": { @@ -6420,6 +6432,15 @@ def test_update_connectivity_test_rest_call_success(request_type): "external_ip": "external_ip_value", "dns_endpoint": "dns_endpoint_value", }, + "gke_pod": { + "pod_uri": "pod_uri_value", + "ip_address": "ip_address_value", + "network_uri": "network_uri_value", + }, + "ip_masquerading_skipped": { + "reason": 1, + "non_masquerade_range": "non_masquerade_range_value", + }, "cloud_sql_instance": { "display_name": "display_name_value", "uri": "uri_value", @@ -6476,6 +6497,7 @@ def test_update_connectivity_test_rest_call_success(request_type): "new_destination_port": 2159, "router_uri": "router_uri_value", "nat_gateway_name": "nat_gateway_name_value", + "cloud_nat_gateway_type": 1, }, "proxy_connection": { "protocol": "protocol_value", diff --git a/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/types/resources.py b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/types/resources.py index e709e972f2ee..3cdf661b56da 100644 --- a/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/types/resources.py +++ b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1/types/resources.py @@ -66,7 +66,7 @@ class QuotaInfo(proto.Message): "locations/" must be "global". Example: ``projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`` quota_id (str): - The id of the quota, which is unquie within the service. + The id of the quota, which is unique within the service. Example: ``CpusPerProjectPerRegion`` metric (str): The metric of the quota. It specifies the resources diff --git a/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/types/resources.py b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/types/resources.py index 877e69fa6cfa..68f1511f0413 100644 --- a/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/types/resources.py +++ b/packages/google-cloud-quotas/google/cloud/cloudquotas_v1beta/types/resources.py @@ -66,7 +66,7 @@ class QuotaInfo(proto.Message): "locations/" must be "global". For example, ``projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion`` quota_id (str): - The id of the quota, which is unquie within the service. For + The id of the quota, which is unique within the service. For example, ``CpusPerProjectPerRegion`` metric (str): The metric of the quota. It specifies the resources diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py index 2dfc0325b6d1..9e89ce1f8ad2 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/__init__.py @@ -95,6 +95,7 @@ ColorInfo, Condition, CustomAttribute, + DoubleList, FulfillmentInfo, Image, Interval, @@ -106,6 +107,7 @@ Rule, SearchSolutionUseCase, SolutionType, + StringList, UserInfo, ) from .types.completion_service import CompleteQueryRequest, CompleteQueryResponse @@ -406,6 +408,7 @@ def _get_version(dependency_name): "DeleteModelRequest", "DeleteProductRequest", "DeleteServingConfigRequest", + "DoubleList", "ExperimentInfo", "ExportAnalyticsMetricsRequest", "ExportAnalyticsMetricsResponse", @@ -513,6 +516,7 @@ def _get_version(dependency_name): "SetInventoryRequest", "SetInventoryResponse", "SolutionType", + "StringList", "Tile", "TuneModelMetadata", "TuneModelRequest", diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/types/__init__.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/types/__init__.py index 5bd8a01a220f..74ddaec46126 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/types/__init__.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/types/__init__.py @@ -46,6 +46,7 @@ ColorInfo, Condition, CustomAttribute, + DoubleList, FulfillmentInfo, Image, Interval, @@ -57,6 +58,7 @@ Rule, SearchSolutionUseCase, SolutionType, + StringList, UserInfo, ) from .completion_service import CompleteQueryRequest, CompleteQueryResponse @@ -226,6 +228,7 @@ "ColorInfo", "Condition", "CustomAttribute", + "DoubleList", "FulfillmentInfo", "Image", "Interval", @@ -234,6 +237,7 @@ "PriceInfo", "Rating", "Rule", + "StringList", "UserInfo", "AttributeConfigLevel", "RecommendationsFilteringOption", diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/types/common.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/types/common.py index 5d1388cd4f7b..ea11e920f249 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/types/common.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/types/common.py @@ -40,6 +40,8 @@ "UserInfo", "LocalInventory", "PinControlMetadata", + "StringList", + "DoubleList", }, ) @@ -1493,4 +1495,32 @@ class ProductPins(proto.Message): ) +class StringList(proto.Message): + r"""A list of string values. + + Attributes: + values (MutableSequence[str]): + String values. + """ + + values: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + + +class DoubleList(proto.Message): + r"""A message with a list of double values. + + Attributes: + values (MutableSequence[float]): + The list of double values. + """ + + values: MutableSequence[float] = proto.RepeatedField( + proto.DOUBLE, + number=1, + ) + + __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-retail/google/cloud/retail_v2beta/types/search_service.py b/packages/google-cloud-retail/google/cloud/retail_v2beta/types/search_service.py index fabae54b5725..f40fa21b8c03 100644 --- a/packages/google-cloud-retail/google/cloud/retail_v2beta/types/search_service.py +++ b/packages/google-cloud-retail/google/cloud/retail_v2beta/types/search_service.py @@ -444,6 +444,17 @@ class SearchRequest(proto.Message): local inventory with the matching product's [LocalInventory.place_id][google.cloud.retail.v2beta.LocalInventory.place_id] for revenue optimization. + user_attributes (MutableMapping[str, google.cloud.retail_v2beta.types.StringList]): + Optional. The user attributes that could be used for + personalization of search results. + + - Populate at most 100 key-value pairs per query. + - Only supports string keys and repeated string values. + - Duplicate keys are not allowed within a single query. + + Example: user_attributes: [ { key: "pets" value { values: + "dog" values: "cat" } }, { key: "state" value { values: "CA" + } } ] """ class SearchMode(proto.Enum): @@ -917,10 +928,11 @@ class QueryExpansionSpec(proto.Message): Default to [Condition.DISABLED][google.cloud.retail.v2beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED]. pin_unexpanded_results (bool): - Whether to pin unexpanded results. If this - field is set to true, unexpanded products are - always at the top of the search results, - followed by the expanded results. + Whether to pin unexpanded results. The + default value is false. If this field is set to + true, unexpanded products are always at the top + of the search results, followed by the expanded + results. """ class Condition(proto.Enum): @@ -1281,6 +1293,12 @@ class TileNavigationSpec(proto.Message): proto.STRING, number=46, ) + user_attributes: MutableMapping[str, common.StringList] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=47, + message=common.StringList, + ) class SearchResponse(proto.Message): @@ -1454,6 +1472,8 @@ class SearchResult(proto.Message): - ``purchased``: Indicates that this product has been purchased before. + model_scores (MutableMapping[str, google.cloud.retail_v2beta.types.DoubleList]): + Google provided available scores. """ id: str = proto.Field( @@ -1487,6 +1507,12 @@ class SearchResult(proto.Message): proto.STRING, number=7, ) + model_scores: MutableMapping[str, common.DoubleList] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=8, + message=common.DoubleList, + ) class Facet(proto.Message): r"""A facet result. diff --git a/packages/grafeas/grafeas/grafeas_v1/types/discovery.py b/packages/grafeas/grafeas/grafeas_v1/types/discovery.py index 43d706fbda35..8e1b665c2523 100644 --- a/packages/grafeas/grafeas/grafeas_v1/types/discovery.py +++ b/packages/grafeas/grafeas/grafeas_v1/types/discovery.py @@ -86,6 +86,9 @@ class DiscoveryOccurrence(proto.Message): files (MutableSequence[grafeas.grafeas_v1.types.DiscoveryOccurrence.File]): Files that make up the resource described by the occurrence. + last_vulnerability_update_time (google.protobuf.timestamp_pb2.Timestamp): + The last time vulnerability scan results + changed. """ class ContinuousAnalysis(proto.Enum): @@ -306,6 +309,11 @@ class File(proto.Message): number=11, message=File, ) + last_vulnerability_update_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=12, + message=timestamp_pb2.Timestamp, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py b/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py index c45689672dad..d3a879a74e04 100644 --- a/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py +++ b/packages/grafeas/tests/unit/gapic/grafeas_v1/test_grafeas.py @@ -9866,6 +9866,7 @@ def test_create_occurrence_rest_call_success(request_type): "error": "error_value", }, "files": [{"name": "name_value", "digest": {}}], + "last_vulnerability_update_time": {}, }, "attestation": { "serialized_payload": b"serialized_payload_blob", @@ -10594,6 +10595,7 @@ def test_update_occurrence_rest_call_success(request_type): "error": "error_value", }, "files": [{"name": "name_value", "digest": {}}], + "last_vulnerability_update_time": {}, }, "attestation": { "serialized_payload": b"serialized_payload_blob",