Skip to content

Commit

Permalink
feat: add a API field to enable FQDN Network Policy on clusters
Browse files Browse the repository at this point in the history
---
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: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuQ29udGFpbmVyLlYxLy5Pd2xCb3QueWFtbCIsImgiOiI4YzQ3ZjIwOGM1ZTcwNGJlMDhhZmNmMjc4ZmIwMjE3NzljYjUzZGEwIn0=
  • Loading branch information
gcf-owl-bot[bot] authored and amanda-tarafa committed Jun 6, 2023
1 parent 735d19b commit a694180
Show file tree
Hide file tree
Showing 8 changed files with 2,821 additions and 831 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 2023 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
//
// https://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!

namespace GoogleCSharpSnippets
{
// [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async]
using Google.Cloud.Container.V1;
using System.Threading.Tasks;

public sealed partial class GeneratedClusterManagerClientSnippets
{
/// <summary>Snippet for CheckAutopilotCompatibilityAsync</summary>
/// <remarks>
/// 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://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task CheckAutopilotCompatibilityRequestObjectAsync()
{
// Create client
ClusterManagerClient clusterManagerClient = await ClusterManagerClient.CreateAsync();
// Initialize request argument(s)
CheckAutopilotCompatibilityRequest request = new CheckAutopilotCompatibilityRequest { Name = "", };
// Make the request
CheckAutopilotCompatibilityResponse response = await clusterManagerClient.CheckAutopilotCompatibilityAsync(request);
}
}
// [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2023 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
//
// https://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!

namespace GoogleCSharpSnippets
{
// [START container_v1_generated_ClusterManager_CheckAutopilotCompatibility_sync]
using Google.Cloud.Container.V1;

public sealed partial class GeneratedClusterManagerClientSnippets
{
/// <summary>Snippet for CheckAutopilotCompatibility</summary>
/// <remarks>
/// 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://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void CheckAutopilotCompatibilityRequestObject()
{
// Create client
ClusterManagerClient clusterManagerClient = ClusterManagerClient.Create();
// Initialize request argument(s)
CheckAutopilotCompatibilityRequest request = new CheckAutopilotCompatibilityRequest { Name = "", };
// Make the request
CheckAutopilotCompatibilityResponse response = clusterManagerClient.CheckAutopilotCompatibility(request);
}
}
// [END container_v1_generated_ClusterManager_CheckAutopilotCompatibility_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -8223,6 +8223,103 @@
"type": "SHORT"
}
]
},
{
"regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_sync",
"title": "CheckAutopilotCompatibilityRequestObject",
"description": "Snippet for CheckAutopilotCompatibility",
"file": "ClusterManagerClient.CheckAutopilotCompatibilityRequestObjectSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "CheckAutopilotCompatibility",
"fullName": "Google.Cloud.Container.V1.ClusterManagerClient.CheckAutopilotCompatibility",
"parameters": [
{
"type": "Google.Cloud.Container.V1.CheckAutopilotCompatibilityRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.Cloud.Container.V1.CheckAutopilotCompatibilityResponse",
"client": {
"shortName": "ClusterManagerClient",
"fullName": "Google.Cloud.Container.V1.ClusterManagerClient"
},
"method": {
"shortName": "CheckAutopilotCompatibility",
"fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility",
"service": {
"shortName": "ClusterManager",
"fullName": "google.container.v1.ClusterManager"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 41,
"type": "FULL"
},
{
"start": 34,
"end": 39,
"type": "SHORT"
}
]
},
{
"regionTag": "container_v1_generated_ClusterManager_CheckAutopilotCompatibility_async",
"title": "CheckAutopilotCompatibilityRequestObjectAsync",
"description": "Snippet for CheckAutopilotCompatibilityAsync",
"file": "ClusterManagerClient.CheckAutopilotCompatibilityRequestObjectAsyncSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "CheckAutopilotCompatibilityAsync",
"fullName": "Google.Cloud.Container.V1.ClusterManagerClient.CheckAutopilotCompatibilityAsync",
"async": true,
"parameters": [
{
"type": "Google.Cloud.Container.V1.CheckAutopilotCompatibilityRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "System.Threading.Tasks.Task<Google.Cloud.Container.V1.CheckAutopilotCompatibilityResponse>",
"client": {
"shortName": "ClusterManagerClient",
"fullName": "Google.Cloud.Container.V1.ClusterManagerClient"
},
"method": {
"shortName": "CheckAutopilotCompatibility",
"fullName": "google.container.v1.ClusterManager.CheckAutopilotCompatibility",
"service": {
"shortName": "ClusterManager",
"fullName": "google.container.v1.ClusterManager"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 42,
"type": "FULL"
},
{
"start": 35,
"end": 40,
"type": "SHORT"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -2692,5 +2692,32 @@ public async Task ListUsableSubnetworksRequestObjectAsync()
string nextPageToken = singlePage.NextPageToken;
// End snippet
}

/// <summary>Snippet for CheckAutopilotCompatibility</summary>
public void CheckAutopilotCompatibilityRequestObject()
{
// Snippet: CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest, CallSettings)
// Create client
ClusterManagerClient clusterManagerClient = ClusterManagerClient.Create();
// Initialize request argument(s)
CheckAutopilotCompatibilityRequest request = new CheckAutopilotCompatibilityRequest { Name = "", };
// Make the request
CheckAutopilotCompatibilityResponse response = clusterManagerClient.CheckAutopilotCompatibility(request);
// End snippet
}

/// <summary>Snippet for CheckAutopilotCompatibilityAsync</summary>
public async Task CheckAutopilotCompatibilityRequestObjectAsync()
{
// Snippet: CheckAutopilotCompatibilityAsync(CheckAutopilotCompatibilityRequest, CallSettings)
// Additional: CheckAutopilotCompatibilityAsync(CheckAutopilotCompatibilityRequest, CancellationToken)
// Create client
ClusterManagerClient clusterManagerClient = await ClusterManagerClient.CreateAsync();
// Initialize request argument(s)
CheckAutopilotCompatibilityRequest request = new CheckAutopilotCompatibilityRequest { Name = "", };
// Make the request
CheckAutopilotCompatibilityResponse response = await clusterManagerClient.CheckAutopilotCompatibilityAsync(request);
// End snippet
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private ClusterManagerSettings(ClusterManagerSettings existing) : base(existing)
SetNetworkPolicySettings = existing.SetNetworkPolicySettings;
SetMaintenancePolicySettings = existing.SetMaintenancePolicySettings;
ListUsableSubnetworksSettings = existing.ListUsableSubnetworksSettings;
CheckAutopilotCompatibilitySettings = existing.CheckAutopilotCompatibilitySettings;
OnCopy(existing);
}

Expand Down Expand Up @@ -566,6 +567,19 @@ private ClusterManagerSettings(ClusterManagerSettings existing) : base(existing)
/// </remarks>
public gaxgrpc::CallSettings ListUsableSubnetworksSettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None);

/// <summary>
/// <see cref="gaxgrpc::CallSettings"/> for synchronous and asynchronous calls to
/// <c>ClusterManagerClient.CheckAutopilotCompatibility</c> and
/// <c>ClusterManagerClient.CheckAutopilotCompatibilityAsync</c>.
/// </summary>
/// <remarks>
/// <list type="bullet">
/// <item><description>This call will not be retried.</description></item>
/// <item><description>No timeout is applied.</description></item>
/// </list>
/// </remarks>
public gaxgrpc::CallSettings CheckAutopilotCompatibilitySettings { get; set; } = gaxgrpc::CallSettings.FromExpiration(gax::Expiration.None);

/// <summary>Creates a deep clone of this object, with all the same property values.</summary>
/// <returns>A deep clone of this <see cref="ClusterManagerSettings"/> object.</returns>
public ClusterManagerSettings Clone() => new ClusterManagerSettings(this);
Expand Down Expand Up @@ -5188,6 +5202,36 @@ internal static ClusterManagerClient Create(grpccore::CallInvoker callInvoker, C
/// <returns>A pageable asynchronous sequence of <see cref="UsableSubnetwork"/> resources.</returns>
public virtual gax::PagedAsyncEnumerable<ListUsableSubnetworksResponse, UsableSubnetwork> ListUsableSubnetworksAsync(ListUsableSubnetworksRequest request, gaxgrpc::CallSettings callSettings = null) =>
throw new sys::NotImplementedException();

/// <summary>
/// Checks the cluster compatibility with Autopilot mode, and returns a list of
/// compatibility issues.
/// </summary>
/// <param name="request">The request object containing all of the parameters for the API call.</param>
/// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
/// <returns>The RPC response.</returns>
public virtual CheckAutopilotCompatibilityResponse CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest request, gaxgrpc::CallSettings callSettings = null) =>
throw new sys::NotImplementedException();

/// <summary>
/// Checks the cluster compatibility with Autopilot mode, and returns a list of
/// compatibility issues.
/// </summary>
/// <param name="request">The request object containing all of the parameters for the API call.</param>
/// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
/// <returns>A Task containing the RPC response.</returns>
public virtual stt::Task<CheckAutopilotCompatibilityResponse> CheckAutopilotCompatibilityAsync(CheckAutopilotCompatibilityRequest request, gaxgrpc::CallSettings callSettings = null) =>
throw new sys::NotImplementedException();

/// <summary>
/// Checks the cluster compatibility with Autopilot mode, and returns a list of
/// compatibility issues.
/// </summary>
/// <param name="request">The request object containing all of the parameters for the API call.</param>
/// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param>
/// <returns>A Task containing the RPC response.</returns>
public virtual stt::Task<CheckAutopilotCompatibilityResponse> CheckAutopilotCompatibilityAsync(CheckAutopilotCompatibilityRequest request, st::CancellationToken cancellationToken) =>
CheckAutopilotCompatibilityAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
}

/// <summary>ClusterManager client wrapper implementation, for convenient use.</summary>
Expand Down Expand Up @@ -5262,6 +5306,8 @@ public sealed partial class ClusterManagerClientImpl : ClusterManagerClient

private readonly gaxgrpc::ApiCall<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse> _callListUsableSubnetworks;

private readonly gaxgrpc::ApiCall<CheckAutopilotCompatibilityRequest, CheckAutopilotCompatibilityResponse> _callCheckAutopilotCompatibility;

/// <summary>
/// Constructs a client wrapper for the ClusterManager service, with the specified gRPC client and settings.
/// </summary>
Expand Down Expand Up @@ -5374,6 +5420,9 @@ public ClusterManagerClientImpl(ClusterManager.ClusterManagerClient grpcClient,
_callListUsableSubnetworks = clientHelper.BuildApiCall<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse>("ListUsableSubnetworks", grpcClient.ListUsableSubnetworksAsync, grpcClient.ListUsableSubnetworks, effectiveSettings.ListUsableSubnetworksSettings).WithGoogleRequestParam("parent", request => request.Parent);
Modify_ApiCall(ref _callListUsableSubnetworks);
Modify_ListUsableSubnetworksApiCall(ref _callListUsableSubnetworks);
_callCheckAutopilotCompatibility = clientHelper.BuildApiCall<CheckAutopilotCompatibilityRequest, CheckAutopilotCompatibilityResponse>("CheckAutopilotCompatibility", grpcClient.CheckAutopilotCompatibilityAsync, grpcClient.CheckAutopilotCompatibility, effectiveSettings.CheckAutopilotCompatibilitySettings).WithGoogleRequestParam("name", request => request.Name);
Modify_ApiCall(ref _callCheckAutopilotCompatibility);
Modify_CheckAutopilotCompatibilityApiCall(ref _callCheckAutopilotCompatibility);
OnConstruction(grpcClient, effectiveSettings, clientHelper);
}

Expand Down Expand Up @@ -5445,6 +5494,8 @@ public ClusterManagerClientImpl(ClusterManager.ClusterManagerClient grpcClient,

partial void Modify_ListUsableSubnetworksApiCall(ref gaxgrpc::ApiCall<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse> call);

partial void Modify_CheckAutopilotCompatibilityApiCall(ref gaxgrpc::ApiCall<CheckAutopilotCompatibilityRequest, CheckAutopilotCompatibilityResponse> call);

partial void OnConstruction(ClusterManager.ClusterManagerClient grpcClient, ClusterManagerSettings effectiveSettings, gaxgrpc::ClientHelper clientHelper);

/// <summary>The underlying gRPC ClusterManager client</summary>
Expand Down Expand Up @@ -5516,6 +5567,8 @@ public ClusterManagerClientImpl(ClusterManager.ClusterManagerClient grpcClient,

partial void Modify_ListUsableSubnetworksRequest(ref ListUsableSubnetworksRequest request, ref gaxgrpc::CallSettings settings);

partial void Modify_CheckAutopilotCompatibilityRequest(ref CheckAutopilotCompatibilityRequest request, ref gaxgrpc::CallSettings settings);

/// <summary>
/// Lists all clusters owned by a project in either the specified zone or all
/// zones.
Expand Down Expand Up @@ -6377,6 +6430,32 @@ public override Operation SetMaintenancePolicy(SetMaintenancePolicyRequest reque
Modify_ListUsableSubnetworksRequest(ref request, ref callSettings);
return new gaxgrpc::GrpcPagedAsyncEnumerable<ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork>(_callListUsableSubnetworks, request, callSettings);
}

/// <summary>
/// Checks the cluster compatibility with Autopilot mode, and returns a list of
/// compatibility issues.
/// </summary>
/// <param name="request">The request object containing all of the parameters for the API call.</param>
/// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
/// <returns>The RPC response.</returns>
public override CheckAutopilotCompatibilityResponse CheckAutopilotCompatibility(CheckAutopilotCompatibilityRequest request, gaxgrpc::CallSettings callSettings = null)
{
Modify_CheckAutopilotCompatibilityRequest(ref request, ref callSettings);
return _callCheckAutopilotCompatibility.Sync(request, callSettings);
}

/// <summary>
/// Checks the cluster compatibility with Autopilot mode, and returns a list of
/// compatibility issues.
/// </summary>
/// <param name="request">The request object containing all of the parameters for the API call.</param>
/// <param name="callSettings">If not null, applies overrides to this RPC call.</param>
/// <returns>A Task containing the RPC response.</returns>
public override stt::Task<CheckAutopilotCompatibilityResponse> CheckAutopilotCompatibilityAsync(CheckAutopilotCompatibilityRequest request, gaxgrpc::CallSettings callSettings = null)
{
Modify_CheckAutopilotCompatibilityRequest(ref request, ref callSettings);
return _callCheckAutopilotCompatibility.Async(request, callSettings);
}
}

public partial class ListUsableSubnetworksRequest : gaxgrpc::IPageRequest
Expand Down
Loading

0 comments on commit a694180

Please sign in to comment.