Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import com.google.container.v1.Cluster;
import com.google.container.v1.ClusterUpdate;
import com.google.container.v1.ClusterUpgradeInfo;
import com.google.container.v1.CompleteControlPlaneUpgradeRequest;
import com.google.container.v1.CompleteIPRotationRequest;
import com.google.container.v1.CompleteNodePoolUpgradeRequest;
import com.google.container.v1.CreateClusterRequest;
Expand Down Expand Up @@ -755,6 +756,20 @@
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> CompleteControlPlaneUpgrade</td>
* <td><p> CompleteControlPlaneUpgrade completes the rollback-safe upgrade by performing the step two upgrade for a specific cluster.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li><p> completeControlPlaneUpgrade(CompleteControlPlaneUpgradeRequest request)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> completeControlPlaneUpgradeCallable()
* </ul>
* </td>
* </tr>
* </table>
*
* <p>See the individual methods for example code.
Expand Down Expand Up @@ -1480,6 +1495,7 @@ public final UnaryCallable<UpdateClusterRequest, Operation> updateClusterCallabl
* .setNodeDrainConfig(NodePool.NodeDrainConfig.newBuilder().build())
* .setConsolidationDelay(Duration.newBuilder().build())
* .setTaintConfig(TaintConfig.newBuilder().build())
* .setMaintenancePolicy(NodePool.NodePoolMaintenancePolicy.newBuilder().build())
* .build();
* Operation response = clusterManagerClient.updateNodePool(request);
* }
Expand Down Expand Up @@ -1547,6 +1563,7 @@ public final Operation updateNodePool(UpdateNodePoolRequest request) {
* .setNodeDrainConfig(NodePool.NodeDrainConfig.newBuilder().build())
* .setConsolidationDelay(Duration.newBuilder().build())
* .setTaintConfig(TaintConfig.newBuilder().build())
* .setMaintenancePolicy(NodePool.NodePoolMaintenancePolicy.newBuilder().build())
* .build();
* ApiFuture<Operation> future =
* clusterManagerClient.updateNodePoolCallable().futureCall(request);
Expand Down Expand Up @@ -5144,6 +5161,67 @@ public final NodePoolUpgradeInfo fetchNodePoolUpgradeInfo(
return stub.fetchNodePoolUpgradeInfoCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* CompleteControlPlaneUpgrade completes the rollback-safe upgrade by performing the step two
* upgrade for a specific cluster.
*
* <p>Sample code:
*
* <pre>{@code
* // 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/java/docs/setup#configure_endpoints_for_the_client_library
* try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
* CompleteControlPlaneUpgradeRequest request =
* CompleteControlPlaneUpgradeRequest.newBuilder()
* .setName("name3373707")
* .setVersion("version351608024")
* .build();
* Operation response = clusterManagerClient.completeControlPlaneUpgrade(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final Operation completeControlPlaneUpgrade(CompleteControlPlaneUpgradeRequest request) {
return completeControlPlaneUpgradeCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* CompleteControlPlaneUpgrade completes the rollback-safe upgrade by performing the step two
* upgrade for a specific cluster.
*
* <p>Sample code:
*
* <pre>{@code
* // 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/java/docs/setup#configure_endpoints_for_the_client_library
* try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
* CompleteControlPlaneUpgradeRequest request =
* CompleteControlPlaneUpgradeRequest.newBuilder()
* .setName("name3373707")
* .setVersion("version351608024")
* .build();
* ApiFuture<Operation> future =
* clusterManagerClient.completeControlPlaneUpgradeCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeCallable() {
return stub.completeControlPlaneUpgradeCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.container.v1.CheckAutopilotCompatibilityResponse;
import com.google.container.v1.Cluster;
import com.google.container.v1.ClusterUpgradeInfo;
import com.google.container.v1.CompleteControlPlaneUpgradeRequest;
import com.google.container.v1.CompleteIPRotationRequest;
import com.google.container.v1.CompleteNodePoolUpgradeRequest;
import com.google.container.v1.CreateClusterRequest;
Expand Down Expand Up @@ -336,6 +337,12 @@ public UnaryCallSettings<SetMaintenancePolicyRequest, Operation> setMaintenanceP
return ((ClusterManagerStubSettings) getStubSettings()).fetchNodePoolUpgradeInfoSettings();
}

/** Returns the object with the settings used for calls to completeControlPlaneUpgrade. */
public UnaryCallSettings<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeSettings() {
return ((ClusterManagerStubSettings) getStubSettings()).completeControlPlaneUpgradeSettings();
}

public static final ClusterManagerSettings create(ClusterManagerStubSettings stub)
throws IOException {
return new ClusterManagerSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -655,6 +662,12 @@ public UnaryCallSettings.Builder<SetNodePoolSizeRequest, Operation> setNodePoolS
return getStubSettingsBuilder().fetchNodePoolUpgradeInfoSettings();
}

/** Returns the builder for the settings used for calls to completeControlPlaneUpgrade. */
public UnaryCallSettings.Builder<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeSettings() {
return getStubSettingsBuilder().completeControlPlaneUpgradeSettings();
}

@Override
public ClusterManagerSettings build() throws IOException {
return new ClusterManagerSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"CheckAutopilotCompatibility": {
"methods": ["checkAutopilotCompatibility", "checkAutopilotCompatibilityCallable"]
},
"CompleteControlPlaneUpgrade": {
"methods": ["completeControlPlaneUpgrade", "completeControlPlaneUpgradeCallable"]
},
"CompleteIPRotation": {
"methods": ["completeIPRotation", "completeIPRotation", "completeIPRotation", "completeIPRotationCallable"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.container.v1.CheckAutopilotCompatibilityResponse;
import com.google.container.v1.Cluster;
import com.google.container.v1.ClusterUpgradeInfo;
import com.google.container.v1.CompleteControlPlaneUpgradeRequest;
import com.google.container.v1.CompleteIPRotationRequest;
import com.google.container.v1.CompleteNodePoolUpgradeRequest;
import com.google.container.v1.CreateClusterRequest;
Expand Down Expand Up @@ -239,6 +240,12 @@ public UnaryCallable<SetMaintenancePolicyRequest, Operation> setMaintenancePolic
throw new UnsupportedOperationException("Not implemented: fetchNodePoolUpgradeInfoCallable()");
}

public UnaryCallable<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeCallable() {
throw new UnsupportedOperationException(
"Not implemented: completeControlPlaneUpgradeCallable()");
}

@Override
public abstract void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import com.google.container.v1.CheckAutopilotCompatibilityResponse;
import com.google.container.v1.Cluster;
import com.google.container.v1.ClusterUpgradeInfo;
import com.google.container.v1.CompleteControlPlaneUpgradeRequest;
import com.google.container.v1.CompleteIPRotationRequest;
import com.google.container.v1.CompleteNodePoolUpgradeRequest;
import com.google.container.v1.CreateClusterRequest;
Expand Down Expand Up @@ -221,6 +222,8 @@ public class ClusterManagerStubSettings extends StubSettings<ClusterManagerStubS
fetchClusterUpgradeInfoSettings;
private final UnaryCallSettings<FetchNodePoolUpgradeInfoRequest, NodePoolUpgradeInfo>
fetchNodePoolUpgradeInfoSettings;
private final UnaryCallSettings<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeSettings;

private static final PagedListDescriptor<
ListUsableSubnetworksRequest, ListUsableSubnetworksResponse, UsableSubnetwork>
Expand Down Expand Up @@ -481,6 +484,12 @@ public UnaryCallSettings<SetMaintenancePolicyRequest, Operation> setMaintenanceP
return fetchNodePoolUpgradeInfoSettings;
}

/** Returns the object with the settings used for calls to completeControlPlaneUpgrade. */
public UnaryCallSettings<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeSettings() {
return completeControlPlaneUpgradeSettings;
}

public ClusterManagerStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down Expand Up @@ -629,6 +638,8 @@ protected ClusterManagerStubSettings(Builder settingsBuilder) throws IOException
settingsBuilder.checkAutopilotCompatibilitySettings().build();
fetchClusterUpgradeInfoSettings = settingsBuilder.fetchClusterUpgradeInfoSettings().build();
fetchNodePoolUpgradeInfoSettings = settingsBuilder.fetchNodePoolUpgradeInfoSettings().build();
completeControlPlaneUpgradeSettings =
settingsBuilder.completeControlPlaneUpgradeSettings().build();
}

@Override
Expand Down Expand Up @@ -707,6 +718,8 @@ public static class Builder extends StubSettings.Builder<ClusterManagerStubSetti
fetchClusterUpgradeInfoSettings;
private final UnaryCallSettings.Builder<FetchNodePoolUpgradeInfoRequest, NodePoolUpgradeInfo>
fetchNodePoolUpgradeInfoSettings;
private final UnaryCallSettings.Builder<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeSettings;
private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
RETRYABLE_CODE_DEFINITIONS;

Expand Down Expand Up @@ -797,6 +810,7 @@ protected Builder(@Nullable ClientContext clientContext) {
checkAutopilotCompatibilitySettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
fetchClusterUpgradeInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
fetchNodePoolUpgradeInfoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
completeControlPlaneUpgradeSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down Expand Up @@ -835,7 +849,8 @@ protected Builder(@Nullable ClientContext clientContext) {
listUsableSubnetworksSettings,
checkAutopilotCompatibilitySettings,
fetchClusterUpgradeInfoSettings,
fetchNodePoolUpgradeInfoSettings);
fetchNodePoolUpgradeInfoSettings,
completeControlPlaneUpgradeSettings);
initDefaults(this);
}

Expand Down Expand Up @@ -879,6 +894,8 @@ protected Builder(ClusterManagerStubSettings settings) {
settings.checkAutopilotCompatibilitySettings.toBuilder();
fetchClusterUpgradeInfoSettings = settings.fetchClusterUpgradeInfoSettings.toBuilder();
fetchNodePoolUpgradeInfoSettings = settings.fetchNodePoolUpgradeInfoSettings.toBuilder();
completeControlPlaneUpgradeSettings =
settings.completeControlPlaneUpgradeSettings.toBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
Expand Down Expand Up @@ -917,7 +934,8 @@ protected Builder(ClusterManagerStubSettings settings) {
listUsableSubnetworksSettings,
checkAutopilotCompatibilitySettings,
fetchClusterUpgradeInfoSettings,
fetchNodePoolUpgradeInfoSettings);
fetchNodePoolUpgradeInfoSettings,
completeControlPlaneUpgradeSettings);
}

private static Builder createDefault() {
Expand Down Expand Up @@ -1125,6 +1143,11 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.completeControlPlaneUpgradeSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

return builder;
}

Expand Down Expand Up @@ -1350,6 +1373,12 @@ public UnaryCallSettings.Builder<SetNodePoolSizeRequest, Operation> setNodePoolS
return fetchNodePoolUpgradeInfoSettings;
}

/** Returns the builder for the settings used for calls to completeControlPlaneUpgrade. */
public UnaryCallSettings.Builder<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeSettings() {
return completeControlPlaneUpgradeSettings;
}

@Override
public ClusterManagerStubSettings build() throws IOException {
return new ClusterManagerStubSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.google.container.v1.CheckAutopilotCompatibilityResponse;
import com.google.container.v1.Cluster;
import com.google.container.v1.ClusterUpgradeInfo;
import com.google.container.v1.CompleteControlPlaneUpgradeRequest;
import com.google.container.v1.CompleteIPRotationRequest;
import com.google.container.v1.CompleteNodePoolUpgradeRequest;
import com.google.container.v1.CreateClusterRequest;
Expand Down Expand Up @@ -486,6 +487,17 @@ public class GrpcClusterManagerStub extends ClusterManagerStub {
.setSampledToLocalTracing(true)
.build();

private static final MethodDescriptor<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeMethodDescriptor =
MethodDescriptor.<CompleteControlPlaneUpgradeRequest, Operation>newBuilder()
.setType(MethodDescriptor.MethodType.UNARY)
.setFullMethodName("google.container.v1.ClusterManager/CompleteControlPlaneUpgrade")
.setRequestMarshaller(
ProtoUtils.marshaller(CompleteControlPlaneUpgradeRequest.getDefaultInstance()))
.setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
.setSampledToLocalTracing(true)
.build();

private final UnaryCallable<ListClustersRequest, ListClustersResponse> listClustersCallable;
private final UnaryCallable<GetClusterRequest, Cluster> getClusterCallable;
private final UnaryCallable<CreateClusterRequest, Operation> createClusterCallable;
Expand Down Expand Up @@ -533,6 +545,8 @@ public class GrpcClusterManagerStub extends ClusterManagerStub {
fetchClusterUpgradeInfoCallable;
private final UnaryCallable<FetchNodePoolUpgradeInfoRequest, NodePoolUpgradeInfo>
fetchNodePoolUpgradeInfoCallable;
private final UnaryCallable<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeCallable;

private final BackgroundResource backgroundResources;
private final GrpcOperationsStub operationsStub;
Expand Down Expand Up @@ -1044,6 +1058,17 @@ protected GrpcClusterManagerStub(
return builder.build();
})
.build();
GrpcCallSettings<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeTransportSettings =
GrpcCallSettings.<CompleteControlPlaneUpgradeRequest, Operation>newBuilder()
.setMethodDescriptor(completeControlPlaneUpgradeMethodDescriptor)
.setParamsExtractor(
request -> {
RequestParamsBuilder builder = RequestParamsBuilder.create();
builder.add("name", String.valueOf(request.getName()));
return builder.build();
})
.build();

this.listClustersCallable =
callableFactory.createUnaryCallable(
Expand Down Expand Up @@ -1182,6 +1207,11 @@ protected GrpcClusterManagerStub(
fetchNodePoolUpgradeInfoTransportSettings,
settings.fetchNodePoolUpgradeInfoSettings(),
clientContext);
this.completeControlPlaneUpgradeCallable =
callableFactory.createUnaryCallable(
completeControlPlaneUpgradeTransportSettings,
settings.completeControlPlaneUpgradeSettings(),
clientContext);

this.backgroundResources =
new BackgroundResourceAggregation(clientContext.getBackgroundResources());
Expand Down Expand Up @@ -1382,6 +1412,12 @@ public UnaryCallable<SetMaintenancePolicyRequest, Operation> setMaintenancePolic
return fetchNodePoolUpgradeInfoCallable;
}

@Override
public UnaryCallable<CompleteControlPlaneUpgradeRequest, Operation>
completeControlPlaneUpgradeCallable() {
return completeControlPlaneUpgradeCallable;
}

@Override
public final void close() {
try {
Expand Down
Loading
Loading