Google Cloud Dataproc v1 API - Class ClusterControllerClient (5.7.0)

public abstract class ClusterControllerClient

Reference documentation and code samples for the Google Cloud Dataproc v1 API class ClusterControllerClient.

ClusterController client wrapper, for convenient use.

Inheritance

object > ClusterControllerClient

Namespace

Google.Cloud.Dataproc.V1

Assembly

Google.Cloud.Dataproc.V1.dll

Remarks

The ClusterControllerService provides methods to manage clusters of Compute Engine instances.

Properties

CreateClusterOperationsClient

public virtual OperationsClient CreateClusterOperationsClient { get; }

The long-running operations client for CreateCluster.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ClusterController service, which is a host of "dataproc.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ClusterController scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default ClusterController scopes are:

DeleteClusterOperationsClient

public virtual OperationsClient DeleteClusterOperationsClient { get; }

The long-running operations client for DeleteCluster.

Property Value
TypeDescription
OperationsClient

DiagnoseClusterOperationsClient

public virtual OperationsClient DiagnoseClusterOperationsClient { get; }

The long-running operations client for DiagnoseCluster.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual ClusterController.ClusterControllerClient GrpcClient { get; }

The underlying gRPC ClusterController client

Property Value
TypeDescription
ClusterControllerClusterControllerClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

StartClusterOperationsClient

public virtual OperationsClient StartClusterOperationsClient { get; }

The long-running operations client for StartCluster.

Property Value
TypeDescription
OperationsClient

StopClusterOperationsClient

public virtual OperationsClient StopClusterOperationsClient { get; }

The long-running operations client for StopCluster.

Property Value
TypeDescription
OperationsClient

UpdateClusterOperationsClient

public virtual OperationsClient UpdateClusterOperationsClient { get; }

The long-running operations client for UpdateCluster.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static ClusterControllerClient Create()

Synchronously creates a ClusterControllerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ClusterControllerClientBuilder.

Returns
TypeDescription
ClusterControllerClient

The created ClusterControllerClient.

CreateAsync(CancellationToken)

public static Task<ClusterControllerClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a ClusterControllerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ClusterControllerClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskClusterControllerClient

The task representing the created ClusterControllerClient.

CreateCluster(CreateClusterRequest, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> CreateCluster(CreateClusterRequest request, CallSettings callSettings = null)

Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
requestCreateClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
CreateClusterRequest request = new CreateClusterRequest
{
    ProjectId = "",
    Cluster = new Cluster(),
    Region = "",
    RequestId = "",
    ActionOnFailedPrimaryWorkers = FailureAction.Unspecified,
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = clusterControllerClient.CreateCluster(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceCreateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

CreateCluster(string, string, Cluster, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> CreateCluster(string projectId, string region, Cluster cluster, CallSettings callSettings = null)

Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterCluster

Required. The cluster to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
Cluster cluster = new Cluster();
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = clusterControllerClient.CreateCluster(projectId, region, cluster);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceCreateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

CreateClusterAsync(CreateClusterRequest, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> CreateClusterAsync(CreateClusterRequest request, CallSettings callSettings = null)

Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
requestCreateClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
CreateClusterRequest request = new CreateClusterRequest
{
    ProjectId = "",
    Cluster = new Cluster(),
    Region = "",
    RequestId = "",
    ActionOnFailedPrimaryWorkers = FailureAction.Unspecified,
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.CreateClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

CreateClusterAsync(CreateClusterRequest, CancellationToken)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> CreateClusterAsync(CreateClusterRequest request, CancellationToken cancellationToken)

Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
requestCreateClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
CreateClusterRequest request = new CreateClusterRequest
{
    ProjectId = "",
    Cluster = new Cluster(),
    Region = "",
    RequestId = "",
    ActionOnFailedPrimaryWorkers = FailureAction.Unspecified,
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.CreateClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

CreateClusterAsync(string, string, Cluster, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> CreateClusterAsync(string projectId, string region, Cluster cluster, CallSettings callSettings = null)

Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterCluster

Required. The cluster to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
Cluster cluster = new Cluster();
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.CreateClusterAsync(projectId, region, cluster);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

CreateClusterAsync(string, string, Cluster, CancellationToken)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> CreateClusterAsync(string projectId, string region, Cluster cluster, CancellationToken cancellationToken)

Creates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterCluster

Required. The cluster to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
Cluster cluster = new Cluster();
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.CreateClusterAsync(projectId, region, cluster);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceCreateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

DeleteCluster(DeleteClusterRequest, CallSettings)

public virtual Operation<Empty, ClusterOperationMetadata> DeleteCluster(DeleteClusterRequest request, CallSettings callSettings = null)

Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
requestDeleteClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
DeleteClusterRequest request = new DeleteClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Empty, ClusterOperationMetadata> response = clusterControllerClient.DeleteCluster(request);

// Poll until the returned long-running operation is complete
Operation<Empty, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceDeleteCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteCluster(string, string, string, CallSettings)

public virtual Operation<Empty, ClusterOperationMetadata> DeleteCluster(string projectId, string region, string clusterName, CallSettings callSettings = null)

Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Operation<Empty, ClusterOperationMetadata> response = clusterControllerClient.DeleteCluster(projectId, region, clusterName);

// Poll until the returned long-running operation is complete
Operation<Empty, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceDeleteCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteClusterAsync(DeleteClusterRequest, CallSettings)

public virtual Task<Operation<Empty, ClusterOperationMetadata>> DeleteClusterAsync(DeleteClusterRequest request, CallSettings callSettings = null)

Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
requestDeleteClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
DeleteClusterRequest request = new DeleteClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Empty, ClusterOperationMetadata> response = await clusterControllerClient.DeleteClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDeleteClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteClusterAsync(DeleteClusterRequest, CancellationToken)

public virtual Task<Operation<Empty, ClusterOperationMetadata>> DeleteClusterAsync(DeleteClusterRequest request, CancellationToken cancellationToken)

Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
requestDeleteClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
DeleteClusterRequest request = new DeleteClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Empty, ClusterOperationMetadata> response = await clusterControllerClient.DeleteClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDeleteClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteClusterAsync(string, string, string, CallSettings)

public virtual Task<Operation<Empty, ClusterOperationMetadata>> DeleteClusterAsync(string projectId, string region, string clusterName, CallSettings callSettings = null)

Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Operation<Empty, ClusterOperationMetadata> response = await clusterControllerClient.DeleteClusterAsync(projectId, region, clusterName);

// Poll until the returned long-running operation is complete
Operation<Empty, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDeleteClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteClusterAsync(string, string, string, CancellationToken)

public virtual Task<Operation<Empty, ClusterOperationMetadata>> DeleteClusterAsync(string projectId, string region, string clusterName, CancellationToken cancellationToken)

Deletes a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationEmptyClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Operation<Empty, ClusterOperationMetadata> response = await clusterControllerClient.DeleteClusterAsync(projectId, region, clusterName);

// Poll until the returned long-running operation is complete
Operation<Empty, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDeleteClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DiagnoseCluster(DiagnoseClusterRequest, CallSettings)

public virtual Operation<DiagnoseClusterResults, ClusterOperationMetadata> DiagnoseCluster(DiagnoseClusterRequest request, CallSettings callSettings = null)

Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. After the operation completes, [Operation.response][google.longrunning.Operation.response] contains DiagnoseClusterResults.

Parameters
NameDescription
requestDiagnoseClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationDiagnoseClusterResultsClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
DiagnoseClusterRequest request = new DiagnoseClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
    TarballGcsDir = "",
    DiagnosisInterval = new Interval(),
    Jobs = { "", },
    YarnApplicationIds = { "", },
};
// Make the request
Operation<DiagnoseClusterResults, ClusterOperationMetadata> response = clusterControllerClient.DiagnoseCluster(request);

// Poll until the returned long-running operation is complete
Operation<DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DiagnoseClusterResults result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceDiagnoseCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
}

DiagnoseCluster(string, string, string, CallSettings)

public virtual Operation<DiagnoseClusterResults, ClusterOperationMetadata> DiagnoseCluster(string projectId, string region, string clusterName, CallSettings callSettings = null)

Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. After the operation completes, [Operation.response][google.longrunning.Operation.response] contains DiagnoseClusterResults.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationDiagnoseClusterResultsClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Operation<DiagnoseClusterResults, ClusterOperationMetadata> response = clusterControllerClient.DiagnoseCluster(projectId, region, clusterName);

// Poll until the returned long-running operation is complete
Operation<DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DiagnoseClusterResults result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceDiagnoseCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
}

DiagnoseClusterAsync(DiagnoseClusterRequest, CallSettings)

public virtual Task<Operation<DiagnoseClusterResults, ClusterOperationMetadata>> DiagnoseClusterAsync(DiagnoseClusterRequest request, CallSettings callSettings = null)

Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. After the operation completes, [Operation.response][google.longrunning.Operation.response] contains DiagnoseClusterResults.

Parameters
NameDescription
requestDiagnoseClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDiagnoseClusterResultsClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
DiagnoseClusterRequest request = new DiagnoseClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
    TarballGcsDir = "",
    DiagnosisInterval = new Interval(),
    Jobs = { "", },
    YarnApplicationIds = { "", },
};
// Make the request
Operation<DiagnoseClusterResults, ClusterOperationMetadata> response = await clusterControllerClient.DiagnoseClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DiagnoseClusterResults result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDiagnoseClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
}

DiagnoseClusterAsync(DiagnoseClusterRequest, CancellationToken)

public virtual Task<Operation<DiagnoseClusterResults, ClusterOperationMetadata>> DiagnoseClusterAsync(DiagnoseClusterRequest request, CancellationToken cancellationToken)

Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. After the operation completes, [Operation.response][google.longrunning.Operation.response] contains DiagnoseClusterResults.

Parameters
NameDescription
requestDiagnoseClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationDiagnoseClusterResultsClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
DiagnoseClusterRequest request = new DiagnoseClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
    TarballGcsDir = "",
    DiagnosisInterval = new Interval(),
    Jobs = { "", },
    YarnApplicationIds = { "", },
};
// Make the request
Operation<DiagnoseClusterResults, ClusterOperationMetadata> response = await clusterControllerClient.DiagnoseClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DiagnoseClusterResults result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDiagnoseClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
}

DiagnoseClusterAsync(string, string, string, CallSettings)

public virtual Task<Operation<DiagnoseClusterResults, ClusterOperationMetadata>> DiagnoseClusterAsync(string projectId, string region, string clusterName, CallSettings callSettings = null)

Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. After the operation completes, [Operation.response][google.longrunning.Operation.response] contains DiagnoseClusterResults.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDiagnoseClusterResultsClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Operation<DiagnoseClusterResults, ClusterOperationMetadata> response = await clusterControllerClient.DiagnoseClusterAsync(projectId, region, clusterName);

// Poll until the returned long-running operation is complete
Operation<DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DiagnoseClusterResults result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDiagnoseClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
}

DiagnoseClusterAsync(string, string, string, CancellationToken)

public virtual Task<Operation<DiagnoseClusterResults, ClusterOperationMetadata>> DiagnoseClusterAsync(string projectId, string region, string clusterName, CancellationToken cancellationToken)

Gets cluster diagnostic information. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. After the operation completes, [Operation.response][google.longrunning.Operation.response] contains DiagnoseClusterResults.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationDiagnoseClusterResultsClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Operation<DiagnoseClusterResults, ClusterOperationMetadata> response = await clusterControllerClient.DiagnoseClusterAsync(projectId, region, clusterName);

// Poll until the returned long-running operation is complete
Operation<DiagnoseClusterResults, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DiagnoseClusterResults result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DiagnoseClusterResults, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceDiagnoseClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    DiagnoseClusterResults retrievedResult = retrievedResponse.Result;
}

GetCluster(GetClusterRequest, CallSettings)

public virtual Cluster GetCluster(GetClusterRequest request, CallSettings callSettings = null)

Gets the resource representation for a cluster in a project.

Parameters
NameDescription
requestGetClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Cluster

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
GetClusterRequest request = new GetClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
};
// Make the request
Cluster response = clusterControllerClient.GetCluster(request);

GetCluster(string, string, string, CallSettings)

public virtual Cluster GetCluster(string projectId, string region, string clusterName, CallSettings callSettings = null)

Gets the resource representation for a cluster in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Cluster

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Cluster response = clusterControllerClient.GetCluster(projectId, region, clusterName);

GetClusterAsync(GetClusterRequest, CallSettings)

public virtual Task<Cluster> GetClusterAsync(GetClusterRequest request, CallSettings callSettings = null)

Gets the resource representation for a cluster in a project.

Parameters
NameDescription
requestGetClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskCluster

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
GetClusterRequest request = new GetClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
};
// Make the request
Cluster response = await clusterControllerClient.GetClusterAsync(request);

GetClusterAsync(GetClusterRequest, CancellationToken)

public virtual Task<Cluster> GetClusterAsync(GetClusterRequest request, CancellationToken cancellationToken)

Gets the resource representation for a cluster in a project.

Parameters
NameDescription
requestGetClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskCluster

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
GetClusterRequest request = new GetClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Region = "",
};
// Make the request
Cluster response = await clusterControllerClient.GetClusterAsync(request);

GetClusterAsync(string, string, string, CallSettings)

public virtual Task<Cluster> GetClusterAsync(string projectId, string region, string clusterName, CallSettings callSettings = null)

Gets the resource representation for a cluster in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskCluster

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Cluster response = await clusterControllerClient.GetClusterAsync(projectId, region, clusterName);

GetClusterAsync(string, string, string, CancellationToken)

public virtual Task<Cluster> GetClusterAsync(string projectId, string region, string clusterName, CancellationToken cancellationToken)

Gets the resource representation for a cluster in a project.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskCluster

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
// Make the request
Cluster response = await clusterControllerClient.GetClusterAsync(projectId, region, clusterName);

ListClusters(ListClustersRequest, CallSettings)

public virtual PagedEnumerable<ListClustersResponse, Cluster> ListClusters(ListClustersRequest request, CallSettings callSettings = null)

Lists all regions/{region}/clusters in a project alphabetically.

Parameters
NameDescription
requestListClustersRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListClustersResponseCluster

A pageable sequence of Cluster resources.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
ListClustersRequest request = new ListClustersRequest
{
    ProjectId = "",
    Region = "",
    Filter = "",
};
// Make the request
PagedEnumerable<ListClustersResponse, Cluster> response = clusterControllerClient.ListClusters(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Cluster item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListClustersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Cluster item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Cluster> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Cluster item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListClusters(string, string, string, int?, CallSettings)

public virtual PagedEnumerable<ListClustersResponse, Cluster> ListClusters(string projectId, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all regions/{region}/clusters in a project alphabetically.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListClustersResponseCluster

A pageable sequence of Cluster resources.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
// Make the request
PagedEnumerable<ListClustersResponse, Cluster> response = clusterControllerClient.ListClusters(projectId, region);

// Iterate over all response items, lazily performing RPCs as required
foreach (Cluster item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListClustersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Cluster item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Cluster> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Cluster item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListClusters(string, string, string, string, int?, CallSettings)

public virtual PagedEnumerable<ListClustersResponse, Cluster> ListClusters(string projectId, string region, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all regions/{region}/clusters in a project alphabetically.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

filterstring

Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:

field = value [AND [field = value]] ...

where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListClustersResponseCluster

A pageable sequence of Cluster resources.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string filter = "";
// Make the request
PagedEnumerable<ListClustersResponse, Cluster> response = clusterControllerClient.ListClusters(projectId, region, filter: filter);

// Iterate over all response items, lazily performing RPCs as required
foreach (Cluster item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListClustersResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Cluster item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Cluster> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Cluster item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListClustersAsync(ListClustersRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListClustersResponse, Cluster> ListClustersAsync(ListClustersRequest request, CallSettings callSettings = null)

Lists all regions/{region}/clusters in a project alphabetically.

Parameters
NameDescription
requestListClustersRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListClustersResponseCluster

A pageable asynchronous sequence of Cluster resources.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
ListClustersRequest request = new ListClustersRequest
{
    ProjectId = "",
    Region = "",
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListClustersResponse, Cluster> response = clusterControllerClient.ListClustersAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Cluster item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListClustersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Cluster item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Cluster> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Cluster item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListClustersAsync(string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListClustersResponse, Cluster> ListClustersAsync(string projectId, string region, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all regions/{region}/clusters in a project alphabetically.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListClustersResponseCluster

A pageable asynchronous sequence of Cluster resources.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
// Make the request
PagedAsyncEnumerable<ListClustersResponse, Cluster> response = clusterControllerClient.ListClustersAsync(projectId, region);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Cluster item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListClustersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Cluster item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Cluster> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Cluster item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListClustersAsync(string, string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListClustersResponse, Cluster> ListClustersAsync(string projectId, string region, string filter, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all regions/{region}/clusters in a project alphabetically.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project that the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

filterstring

Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:

field = value [AND [field = value]] ...

where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.

Example filter:

status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListClustersResponseCluster

A pageable asynchronous sequence of Cluster resources.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string filter = "";
// Make the request
PagedAsyncEnumerable<ListClustersResponse, Cluster> response = clusterControllerClient.ListClustersAsync(projectId, region, filter: filter);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Cluster item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListClustersResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Cluster item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Cluster> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Cluster item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

PollOnceCreateCluster(string, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> PollOnceCreateCluster(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The result of polling the operation.

PollOnceCreateClusterAsync(string, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> PollOnceCreateClusterAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteCluster(string, CallSettings)

public virtual Operation<Empty, ClusterOperationMetadata> PollOnceDeleteCluster(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationEmptyClusterOperationMetadata

The result of polling the operation.

PollOnceDeleteClusterAsync(string, CallSettings)

public virtual Task<Operation<Empty, ClusterOperationMetadata>> PollOnceDeleteClusterAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationEmptyClusterOperationMetadata

A task representing the result of polling the operation.

PollOnceDiagnoseCluster(string, CallSettings)

public virtual Operation<DiagnoseClusterResults, ClusterOperationMetadata> PollOnceDiagnoseCluster(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DiagnoseCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationDiagnoseClusterResultsClusterOperationMetadata

The result of polling the operation.

PollOnceDiagnoseClusterAsync(string, CallSettings)

public virtual Task<Operation<DiagnoseClusterResults, ClusterOperationMetadata>> PollOnceDiagnoseClusterAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DiagnoseCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDiagnoseClusterResultsClusterOperationMetadata

A task representing the result of polling the operation.

PollOnceStartCluster(string, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> PollOnceStartCluster(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of StartCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The result of polling the operation.

PollOnceStartClusterAsync(string, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> PollOnceStartClusterAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of StartCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A task representing the result of polling the operation.

PollOnceStopCluster(string, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> PollOnceStopCluster(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of StopCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The result of polling the operation.

PollOnceStopClusterAsync(string, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> PollOnceStopClusterAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of StopCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A task representing the result of polling the operation.

PollOnceUpdateCluster(string, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> PollOnceUpdateCluster(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of UpdateCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The result of polling the operation.

PollOnceUpdateClusterAsync(string, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> PollOnceUpdateClusterAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of UpdateCluster.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

StartCluster(StartClusterRequest, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> StartCluster(StartClusterRequest request, CallSettings callSettings = null)

Starts a cluster in a project.

Parameters
NameDescription
requestStartClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
StartClusterRequest request = new StartClusterRequest
{
    ProjectId = "",
    Region = "",
    ClusterName = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = clusterControllerClient.StartCluster(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceStartCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

StartClusterAsync(StartClusterRequest, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> StartClusterAsync(StartClusterRequest request, CallSettings callSettings = null)

Starts a cluster in a project.

Parameters
NameDescription
requestStartClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
StartClusterRequest request = new StartClusterRequest
{
    ProjectId = "",
    Region = "",
    ClusterName = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.StartClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceStartClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

StartClusterAsync(StartClusterRequest, CancellationToken)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> StartClusterAsync(StartClusterRequest request, CancellationToken cancellationToken)

Starts a cluster in a project.

Parameters
NameDescription
requestStartClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
StartClusterRequest request = new StartClusterRequest
{
    ProjectId = "",
    Region = "",
    ClusterName = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.StartClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceStartClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

StopCluster(StopClusterRequest, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> StopCluster(StopClusterRequest request, CallSettings callSettings = null)

Stops a cluster in a project.

Parameters
NameDescription
requestStopClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
StopClusterRequest request = new StopClusterRequest
{
    ProjectId = "",
    Region = "",
    ClusterName = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = clusterControllerClient.StopCluster(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceStopCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

StopClusterAsync(StopClusterRequest, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> StopClusterAsync(StopClusterRequest request, CallSettings callSettings = null)

Stops a cluster in a project.

Parameters
NameDescription
requestStopClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
StopClusterRequest request = new StopClusterRequest
{
    ProjectId = "",
    Region = "",
    ClusterName = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.StopClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceStopClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

StopClusterAsync(StopClusterRequest, CancellationToken)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> StopClusterAsync(StopClusterRequest request, CancellationToken cancellationToken)

Stops a cluster in a project.

Parameters
NameDescription
requestStopClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
StopClusterRequest request = new StopClusterRequest
{
    ProjectId = "",
    Region = "",
    ClusterName = "",
    ClusterUuid = "",
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.StopClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceStopClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

UpdateCluster(UpdateClusterRequest, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> UpdateCluster(UpdateClusterRequest request, CallSettings callSettings = null)

Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.

Parameters
NameDescription
requestUpdateClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
UpdateClusterRequest request = new UpdateClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Cluster = new Cluster(),
    UpdateMask = new FieldMask(),
    Region = "",
    GracefulDecommissionTimeout = new Duration(),
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = clusterControllerClient.UpdateCluster(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceUpdateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

UpdateCluster(string, string, string, Cluster, FieldMask, CallSettings)

public virtual Operation<Cluster, ClusterOperationMetadata> UpdateCluster(string projectId, string region, string clusterName, Cluster cluster, FieldMask updateMask, CallSettings callSettings = null)

Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

clusterCluster

Required. The changes to the cluster.

updateMaskFieldMask

Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:

{ "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:

{ "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } <strong>Note:</strong> Currently, only the following fields can be updated:

<table> <tbody> <tr> <td><strong>Mask</strong></td> <td><strong>Purpose</strong></td> </tr> <tr> <td><strong><em>labels</em></strong></td> <td>Update labels</td> </tr> <tr> <td><strong><em>config.worker_config.num_instances</em></strong></td> <td>Resize primary worker group</td> </tr> <tr> <td><strong><em>config.secondary_worker_config.num_instances</em></strong></td> <td>Resize secondary worker group</td> </tr> <tr> <td>config.autoscaling_config.policy_uri</td><td>Use, stop using, or change autoscaling policies</td> </tr> </tbody> </table>

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationClusterClusterOperationMetadata

The RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = ClusterControllerClient.Create();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
Cluster cluster = new Cluster();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = clusterControllerClient.UpdateCluster(projectId, region, clusterName, cluster, updateMask);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = clusterControllerClient.PollOnceUpdateCluster(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

UpdateClusterAsync(UpdateClusterRequest, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> UpdateClusterAsync(UpdateClusterRequest request, CallSettings callSettings = null)

Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.

Parameters
NameDescription
requestUpdateClusterRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
UpdateClusterRequest request = new UpdateClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Cluster = new Cluster(),
    UpdateMask = new FieldMask(),
    Region = "",
    GracefulDecommissionTimeout = new Duration(),
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.UpdateClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceUpdateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

UpdateClusterAsync(UpdateClusterRequest, CancellationToken)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> UpdateClusterAsync(UpdateClusterRequest request, CancellationToken cancellationToken)

Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.

Parameters
NameDescription
requestUpdateClusterRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
UpdateClusterRequest request = new UpdateClusterRequest
{
    ProjectId = "",
    ClusterName = "",
    Cluster = new Cluster(),
    UpdateMask = new FieldMask(),
    Region = "",
    GracefulDecommissionTimeout = new Duration(),
    RequestId = "",
};
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.UpdateClusterAsync(request);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceUpdateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

UpdateClusterAsync(string, string, string, Cluster, FieldMask, CallSettings)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> UpdateClusterAsync(string projectId, string region, string clusterName, Cluster cluster, FieldMask updateMask, CallSettings callSettings = null)

Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

clusterCluster

Required. The changes to the cluster.

updateMaskFieldMask

Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:

{ "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:

{ "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } <strong>Note:</strong> Currently, only the following fields can be updated:

<table> <tbody> <tr> <td><strong>Mask</strong></td> <td><strong>Purpose</strong></td> </tr> <tr> <td><strong><em>labels</em></strong></td> <td>Update labels</td> </tr> <tr> <td><strong><em>config.worker_config.num_instances</em></strong></td> <td>Resize primary worker group</td> </tr> <tr> <td><strong><em>config.secondary_worker_config.num_instances</em></strong></td> <td>Resize secondary worker group</td> </tr> <tr> <td>config.autoscaling_config.policy_uri</td><td>Use, stop using, or change autoscaling policies</td> </tr> </tbody> </table>

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
Cluster cluster = new Cluster();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.UpdateClusterAsync(projectId, region, clusterName, cluster, updateMask);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceUpdateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}

UpdateClusterAsync(string, string, string, Cluster, FieldMask, CancellationToken)

public virtual Task<Operation<Cluster, ClusterOperationMetadata>> UpdateClusterAsync(string projectId, string region, string clusterName, Cluster cluster, FieldMask updateMask, CancellationToken cancellationToken)

Updates a cluster in a project. The returned [Operation.metadata][google.longrunning.Operation.metadata] will be ClusterOperationMetadata. The cluster must be in a [RUNNING][google.cloud.dataproc.v1.ClusterStatus.State] state or an error is returned.

Parameters
NameDescription
projectIdstring

Required. The ID of the Google Cloud Platform project the cluster belongs to.

regionstring

Required. The Dataproc region in which to handle the request.

clusterNamestring

Required. The cluster name.

clusterCluster

Required. The changes to the cluster.

updateMaskFieldMask

Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:

{ "config":{ "workerConfig":{ "numInstances":"5" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:

{ "config":{ "secondaryWorkerConfig":{ "numInstances":"5" } } } <strong>Note:</strong> Currently, only the following fields can be updated:

<table> <tbody> <tr> <td><strong>Mask</strong></td> <td><strong>Purpose</strong></td> </tr> <tr> <td><strong><em>labels</em></strong></td> <td>Update labels</td> </tr> <tr> <td><strong><em>config.worker_config.num_instances</em></strong></td> <td>Resize primary worker group</td> </tr> <tr> <td><strong><em>config.secondary_worker_config.num_instances</em></strong></td> <td>Resize secondary worker group</td> </tr> <tr> <td>config.autoscaling_config.policy_uri</td><td>Use, stop using, or change autoscaling policies</td> </tr> </tbody> </table>

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationClusterClusterOperationMetadata

A Task containing the RPC response.

Example
// Create client
ClusterControllerClient clusterControllerClient = await ClusterControllerClient.CreateAsync();
// Initialize request argument(s)
string projectId = "";
string region = "";
string clusterName = "";
Cluster cluster = new Cluster();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Cluster, ClusterOperationMetadata> response = await clusterControllerClient.UpdateClusterAsync(projectId, region, clusterName, cluster, updateMask);

// Poll until the returned long-running operation is complete
Operation<Cluster, ClusterOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Cluster result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Cluster, ClusterOperationMetadata> retrievedResponse = await clusterControllerClient.PollOnceUpdateClusterAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Cluster retrievedResult = retrievedResponse.Result;
}