Skip to content

Commit

Permalink
feat: add a API field to enable FQDN Network Policy on clusters (#375)
Browse files Browse the repository at this point in the history
* feat: add a API field to enable FQDN Network Policy on clusters

---
feat: turn on public visibility for best effort provision

---
feat: add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster
PiperOrigin-RevId: 537883922

Source-Link: googleapis/googleapis@e1de7d7

Source-Link: googleapis/googleapis-gen@66f4014
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjZmNDAxNGNmZTg1OTg0YjE3MWQyMGM2YWQ1ZDczZmVkMjdhOTY4MCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: add a API field to enable FQDN Network Policy on clusters

---
feat: turn on public visibility for best effort provision

---
feat: add CheckAutopilotCompatibility API to get autopilot compatibility issues for a given standard cluster
PiperOrigin-RevId: 537987027

Source-Link: googleapis/googleapis@5a57359

Source-Link: googleapis/googleapis-gen@8c47f20
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGM0N2YyMDhjNWU3MDRiZTA4YWZjZjI3OGZiMDIxNzc5Y2I1M2RhMCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jun 6, 2023
1 parent 07ac6ee commit c1e61eb
Show file tree
Hide file tree
Showing 29 changed files with 1,834 additions and 2 deletions.
10 changes: 10 additions & 0 deletions packages/google-cloud-container/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
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
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
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
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

0 comments on commit c1e61eb

Please sign in to comment.