Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions google/cloud/container/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@
AdvancedMachineFeatures,
AuthenticatorGroupsConfig,
Autopilot,
AutopilotCompatibilityIssue,
AutoprovisioningNodePoolDefaults,
AutoUpgradeOptions,
BestEffortProvisioning,
BinaryAuthorization,
BlueGreenSettings,
CancelOperationRequest,
CheckAutopilotCompatibilityRequest,
CheckAutopilotCompatibilityResponse,
ClientCertificateConfig,
CloudRunConfig,
Cluster,
Expand Down Expand Up @@ -81,6 +85,7 @@
IPAllocationPolicy,
IPv6AccessType,
Jwk,
K8sBetaAPIConfig,
KubernetesDashboard,
LegacyAbac,
LinuxNodeConfig,
Expand Down Expand Up @@ -185,11 +190,15 @@
"AdvancedMachineFeatures",
"AuthenticatorGroupsConfig",
"Autopilot",
"AutopilotCompatibilityIssue",
"AutoprovisioningNodePoolDefaults",
"AutoUpgradeOptions",
"BestEffortProvisioning",
"BinaryAuthorization",
"BlueGreenSettings",
"CancelOperationRequest",
"CheckAutopilotCompatibilityRequest",
"CheckAutopilotCompatibilityResponse",
"ClientCertificateConfig",
"CloudRunConfig",
"Cluster",
Expand Down Expand Up @@ -233,6 +242,7 @@
"IntraNodeVisibilityConfig",
"IPAllocationPolicy",
"Jwk",
"K8sBetaAPIConfig",
"KubernetesDashboard",
"LegacyAbac",
"LinuxNodeConfig",
Expand Down
10 changes: 10 additions & 0 deletions google/cloud/container_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
AdvancedMachineFeatures,
AuthenticatorGroupsConfig,
Autopilot,
AutopilotCompatibilityIssue,
AutoprovisioningNodePoolDefaults,
AutoUpgradeOptions,
BestEffortProvisioning,
BinaryAuthorization,
BlueGreenSettings,
CancelOperationRequest,
CheckAutopilotCompatibilityRequest,
CheckAutopilotCompatibilityResponse,
ClientCertificateConfig,
CloudRunConfig,
Cluster,
Expand Down Expand Up @@ -76,6 +80,7 @@
IPAllocationPolicy,
IPv6AccessType,
Jwk,
K8sBetaAPIConfig,
KubernetesDashboard,
LegacyAbac,
LinuxNodeConfig,
Expand Down Expand Up @@ -180,10 +185,14 @@
"AuthenticatorGroupsConfig",
"AutoUpgradeOptions",
"Autopilot",
"AutopilotCompatibilityIssue",
"AutoprovisioningNodePoolDefaults",
"BestEffortProvisioning",
"BinaryAuthorization",
"BlueGreenSettings",
"CancelOperationRequest",
"CheckAutopilotCompatibilityRequest",
"CheckAutopilotCompatibilityResponse",
"ClientCertificateConfig",
"CloudRunConfig",
"Cluster",
Expand Down Expand Up @@ -230,6 +239,7 @@
"IdentityServiceConfig",
"IntraNodeVisibilityConfig",
"Jwk",
"K8sBetaAPIConfig",
"KubernetesDashboard",
"LegacyAbac",
"LinuxNodeConfig",
Expand Down
10 changes: 10 additions & 0 deletions google/cloud/container_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"cancel_operation"
]
},
"CheckAutopilotCompatibility": {
"methods": [
"check_autopilot_compatibility"
]
},
"CompleteIPRotation": {
"methods": [
"complete_ip_rotation"
Expand Down Expand Up @@ -185,6 +190,11 @@
"cancel_operation"
]
},
"CheckAutopilotCompatibility": {
"methods": [
"check_autopilot_compatibility"
]
},
"CompleteIPRotation": {
"methods": [
"complete_ip_rotation"
Expand Down
83 changes: 83 additions & 0 deletions google/cloud/container_v1/services/cluster_manager/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4614,6 +4614,89 @@ async def sample_list_usable_subnetworks():
# Done; return the response.
return response

async def check_autopilot_compatibility(
self,
request: Optional[
Union[cluster_service.CheckAutopilotCompatibilityRequest, dict]
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.CheckAutopilotCompatibilityResponse:
r"""Checks the cluster compatibility with Autopilot mode,
and returns a list of compatibility issues.

.. 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_v1

async def sample_check_autopilot_compatibility():
# Create a client
client = container_v1.ClusterManagerAsyncClient()

# Initialize request argument(s)
request = container_v1.CheckAutopilotCompatibilityRequest(
)

# Make the request
response = await client.check_autopilot_compatibility(request=request)

# Handle the response
print(response)

Args:
request (Optional[Union[google.cloud.container_v1.types.CheckAutopilotCompatibilityRequest, dict]]):
The request object. CheckAutopilotCompatibilityRequest
requests getting the blockers for the
given operation in the cluster.
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, str]]): Strings which should be
sent along with the request as metadata.

Returns:
google.cloud.container_v1.types.CheckAutopilotCompatibilityResponse:
CheckAutopilotCompatibilityResponse
has a list of compatibility issues.

"""
# Create or coerce a protobuf request object.
request = cluster_service.CheckAutopilotCompatibilityRequest(request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.check_autopilot_compatibility,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)

# 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),)),
)

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def __aenter__(self):
return self

Expand Down
86 changes: 86 additions & 0 deletions google/cloud/container_v1/services/cluster_manager/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4761,6 +4761,92 @@ def sample_list_usable_subnetworks():
# Done; return the response.
return response

def check_autopilot_compatibility(
self,
request: Optional[
Union[cluster_service.CheckAutopilotCompatibilityRequest, dict]
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> cluster_service.CheckAutopilotCompatibilityResponse:
r"""Checks the cluster compatibility with Autopilot mode,
and returns a list of compatibility issues.

.. 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_v1

def sample_check_autopilot_compatibility():
# Create a client
client = container_v1.ClusterManagerClient()

# Initialize request argument(s)
request = container_v1.CheckAutopilotCompatibilityRequest(
)

# Make the request
response = client.check_autopilot_compatibility(request=request)

# Handle the response
print(response)

Args:
request (Union[google.cloud.container_v1.types.CheckAutopilotCompatibilityRequest, dict]):
The request object. CheckAutopilotCompatibilityRequest
requests getting the blockers for the
given operation in the cluster.
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, str]]): Strings which should be
sent along with the request as metadata.

Returns:
google.cloud.container_v1.types.CheckAutopilotCompatibilityResponse:
CheckAutopilotCompatibilityResponse
has a list of compatibility issues.

"""
# Create or coerce a protobuf request object.
# Minor optimization to avoid making a copy if the user passes
# in a cluster_service.CheckAutopilotCompatibilityRequest.
# There's no risk of modifying the input as we've already verified
# there are no flattened fields.
if not isinstance(request, cluster_service.CheckAutopilotCompatibilityRequest):
request = cluster_service.CheckAutopilotCompatibilityRequest(request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[
self._transport.check_autopilot_compatibility
]

# 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),)),
)

# Send the request.
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

def __enter__(self) -> "ClusterManagerClient":
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ def _prep_wrapped_messages(self, client_info):
default_timeout=None,
client_info=client_info,
),
self.check_autopilot_compatibility: gapic_v1.method.wrap_method(
self.check_autopilot_compatibility,
default_timeout=None,
client_info=client_info,
),
}

def close(self):
Expand Down Expand Up @@ -701,6 +706,18 @@ def list_usable_subnetworks(
]:
raise NotImplementedError()

@property
def check_autopilot_compatibility(
self,
) -> Callable[
[cluster_service.CheckAutopilotCompatibilityRequest],
Union[
cluster_service.CheckAutopilotCompatibilityResponse,
Awaitable[cluster_service.CheckAutopilotCompatibilityResponse],
],
]:
raise NotImplementedError()

@property
def kind(self) -> str:
raise NotImplementedError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,38 @@ def list_usable_subnetworks(
)
return self._stubs["list_usable_subnetworks"]

@property
def check_autopilot_compatibility(
self,
) -> Callable[
[cluster_service.CheckAutopilotCompatibilityRequest],
cluster_service.CheckAutopilotCompatibilityResponse,
]:
r"""Return a callable for the check autopilot compatibility method over gRPC.

Checks the cluster compatibility with Autopilot mode,
and returns a list of compatibility issues.

Returns:
Callable[[~.CheckAutopilotCompatibilityRequest],
~.CheckAutopilotCompatibilityResponse]:
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 "check_autopilot_compatibility" not in self._stubs:
self._stubs[
"check_autopilot_compatibility"
] = self.grpc_channel.unary_unary(
"/google.container.v1.ClusterManager/CheckAutopilotCompatibility",
request_serializer=cluster_service.CheckAutopilotCompatibilityRequest.serialize,
response_deserializer=cluster_service.CheckAutopilotCompatibilityResponse.deserialize,
)
return self._stubs["check_autopilot_compatibility"]

def close(self):
self.grpc_channel.close()

Expand Down
Loading