use of com.google.container.v1beta1.CancelOperationRequest in project java-container by googleapis.
the class ClusterManagerClient method cancelOperation.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels the specified operation.
*
* <p>Sample code:
*
* <pre>{@code
* try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
* String projectId = "projectId-894832108";
* String zone = "zone3744684";
* String operationId = "operationId129704162";
* clusterManagerClient.cancelOperation(projectId, zone, operationId);
* }
* }</pre>
*
* @param projectId Required. Deprecated. The Google Developers Console [project ID or project
* number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
* and replaced by the name field.
* @param zone Required. Deprecated. The name of the Google Compute Engine
* [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation
* resides. This field has been deprecated and replaced by the name field.
* @param operationId Required. Deprecated. The server-assigned `name` of the operation. This
* field has been deprecated and replaced by the name field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void cancelOperation(String projectId, String zone, String operationId) {
CancelOperationRequest request = CancelOperationRequest.newBuilder().setProjectId(projectId).setZone(zone).setOperationId(operationId).build();
cancelOperation(request);
}
use of com.google.container.v1beta1.CancelOperationRequest in project java-container by googleapis.
the class ClusterManagerClient method cancelOperation.
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Cancels the specified operation.
*
* <p>Sample code:
*
* <pre>{@code
* try (ClusterManagerClient clusterManagerClient = ClusterManagerClient.create()) {
* String projectId = "projectId-894832108";
* String zone = "zone3744684";
* String operationId = "operationId129704162";
* clusterManagerClient.cancelOperation(projectId, zone, operationId);
* }
* }</pre>
*
* @param projectId Deprecated. The Google Developers Console [project ID or project
* number](https://support.google.com/cloud/answer/6158840). This field has been deprecated
* and replaced by the name field.
* @param zone Deprecated. The name of the Google Compute Engine
* [zone](https://cloud.google.com/compute/docs/zones#available) in which the operation
* resides. This field has been deprecated and replaced by the name field.
* @param operationId Deprecated. The server-assigned `name` of the operation. This field has been
* deprecated and replaced by the name field.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final void cancelOperation(String projectId, String zone, String operationId) {
CancelOperationRequest request = CancelOperationRequest.newBuilder().setProjectId(projectId).setZone(zone).setOperationId(operationId).build();
cancelOperation(request);
}
use of com.google.container.v1beta1.CancelOperationRequest in project java-container by googleapis.
the class ClusterManagerClientTest method cancelOperationTest.
@Test
public void cancelOperationTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockClusterManager.addResponse(expectedResponse);
String name = "name3373707";
client.cancelOperation(name);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
CancelOperationRequest actualRequest = ((CancelOperationRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1beta1.CancelOperationRequest in project java-container by googleapis.
the class ClusterManagerClientTest method cancelOperationTest2.
@Test
public void cancelOperationTest2() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockClusterManager.addResponse(expectedResponse);
String projectId = "projectId-894832108";
String zone = "zone3744684";
String operationId = "operationId129704162";
client.cancelOperation(projectId, zone, operationId);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
CancelOperationRequest actualRequest = ((CancelOperationRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(operationId, actualRequest.getOperationId());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1beta1.CancelOperationRequest in project java-container by googleapis.
the class ClusterManagerClientTest method cancelOperationTest.
@Test
public void cancelOperationTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockClusterManager.addResponse(expectedResponse);
String projectId = "projectId-894832108";
String zone = "zone3744684";
String operationId = "operationId129704162";
client.cancelOperation(projectId, zone, operationId);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
CancelOperationRequest actualRequest = ((CancelOperationRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(operationId, actualRequest.getOperationId());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations