Skip to content

Commit

Permalink
feat(dataproc-v1): Support for tarball_access parameter to the diagno…
Browse files Browse the repository at this point in the history
…se_cluster RPC (#27287)
  • Loading branch information
gcf-owl-bot[bot] committed Sep 4, 2024
1 parent f39aa15 commit 96bb087
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,7 @@ def list_clusters request, options = nil
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil)
# @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil)
# Pass arguments to `diagnose_cluster` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
Expand All @@ -1147,6 +1147,9 @@ def list_clusters request, options = nil
# Optional. The output Cloud Storage directory for the diagnostic
# tarball. If not specified, a task-specific directory in the cluster's
# staging bucket will be used.
# @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess]
# Optional. (Optional) The access type to the diagnostic tarball. If not
# specified, falls back to default access of the bucket
# @param diagnosis_interval [::Google::Type::Interval, ::Hash]
# Optional. Time interval in which diagnosis should be carried out on the
# cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ def list_clusters request, options = nil
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil)
# @overload diagnose_cluster(project_id: nil, region: nil, cluster_name: nil, tarball_gcs_dir: nil, tarball_access: nil, diagnosis_interval: nil, jobs: nil, yarn_application_ids: nil)
# Pass arguments to `diagnose_cluster` via keyword arguments. Note that at
# least one keyword argument is required. To specify no parameters, or to keep all
# the default parameter values, pass an empty Hash as a request object (see above).
Expand All @@ -1056,6 +1056,9 @@ def list_clusters request, options = nil
# Optional. The output Cloud Storage directory for the diagnostic
# tarball. If not specified, a task-specific directory in the cluster's
# staging bucket will be used.
# @param tarball_access [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess]
# Optional. (Optional) The access type to the diagnostic tarball. If not
# specified, falls back to default access of the bucket
# @param diagnosis_interval [::Google::Type::Interval, ::Hash]
# Optional. Time interval in which diagnosis should be carried out on the
# cluster.
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,10 @@ class ListClustersResponse
# Optional. The output Cloud Storage directory for the diagnostic
# tarball. If not specified, a task-specific directory in the cluster's
# staging bucket will be used.
# @!attribute [rw] tarball_access
# @return [::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest::TarballAccess]
# Optional. (Optional) The access type to the diagnostic tarball. If not
# specified, falls back to default access of the bucket
# @!attribute [rw] diagnosis_interval
# @return [::Google::Type::Interval]
# Optional. Time interval in which diagnosis should be carried out on the
Expand All @@ -1561,6 +1565,20 @@ class ListClustersResponse
class DiagnoseClusterRequest
include ::Google::Protobuf::MessageExts
extend ::Google::Protobuf::MessageExts::ClassMethods

# Defines who has access to the diagnostic tarball
module TarballAccess
# Tarball Access unspecified. Falls back to default access of the bucket
TARBALL_ACCESS_UNSPECIFIED = 0

# Google Cloud Support group has read access to the
# diagnostic tarball
GOOGLE_CLOUD_SUPPORT = 1

# Google Cloud Dataproc Diagnose service account has read access to the
# diagnostic tarball
GOOGLE_DATAPROC_DIAGNOSE = 2
end
end

# The location of diagnostic output.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ def test_diagnose_cluster
region = "hello world"
cluster_name = "hello world"
tarball_gcs_dir = "hello world"
tarball_access = :TARBALL_ACCESS_UNSPECIFIED
diagnosis_interval = {}
jobs = ["hello world"]
yarn_application_ids = ["hello world"]
Expand All @@ -506,27 +507,27 @@ def test_diagnose_cluster
end

# Use hash object
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |_result, response|
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |_result, response|
assert_equal http_response, response.underlying_op
end

# Use named arguments
client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |_result, response|
client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |_result, response|
assert_equal http_response, response.underlying_op
end

# Use protobuf object
client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |_result, response|
client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |_result, response|
assert_equal http_response, response.underlying_op
end

# Use hash object with options
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, call_options) do |_result, response|
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, call_options) do |_result, response|
assert_equal http_response, response.underlying_op
end

# Use protobuf object with options
client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), call_options) do |_result, response|
client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), call_options) do |_result, response|
assert_equal http_response, response.underlying_op
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ def test_diagnose_cluster
region = "hello world"
cluster_name = "hello world"
tarball_gcs_dir = "hello world"
tarball_access = :TARBALL_ACCESS_UNSPECIFIED
diagnosis_interval = {}
jobs = ["hello world"]
yarn_application_ids = ["hello world"]
Expand All @@ -570,6 +571,7 @@ def test_diagnose_cluster
assert_equal "hello world", request["region"]
assert_equal "hello world", request["cluster_name"]
assert_equal "hello world", request["tarball_gcs_dir"]
assert_equal :TARBALL_ACCESS_UNSPECIFIED, request["tarball_access"]
assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Type::Interval), request["diagnosis_interval"]
assert_equal ["hello world"], request["jobs"]
assert_equal ["hello world"], request["yarn_application_ids"]
Expand All @@ -583,35 +585,35 @@ def test_diagnose_cluster
end

# Use hash object
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |response, operation|
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }) do |response, operation|
assert_kind_of Gapic::Operation, response
assert_equal grpc_response, response.grpc_op
assert_equal grpc_operation, operation
end

# Use named arguments
client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |response, operation|
client.diagnose_cluster project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids do |response, operation|
assert_kind_of Gapic::Operation, response
assert_equal grpc_response, response.grpc_op
assert_equal grpc_operation, operation
end

# Use protobuf object
client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |response, operation|
client.diagnose_cluster ::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids) do |response, operation|
assert_kind_of Gapic::Operation, response
assert_equal grpc_response, response.grpc_op
assert_equal grpc_operation, operation
end

# Use hash object with options
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, grpc_options) do |response, operation|
client.diagnose_cluster({ project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids }, grpc_options) do |response, operation|
assert_kind_of Gapic::Operation, response
assert_equal grpc_response, response.grpc_op
assert_equal grpc_operation, operation
end

# Use protobuf object with options
client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), grpc_options) do |response, operation|
client.diagnose_cluster(::Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new(project_id: project_id, region: region, cluster_name: cluster_name, tarball_gcs_dir: tarball_gcs_dir, tarball_access: tarball_access, diagnosis_interval: diagnosis_interval, jobs: jobs, yarn_application_ids: yarn_application_ids), grpc_options) do |response, operation|
assert_kind_of Gapic::Operation, response
assert_equal grpc_response, response.grpc_op
assert_equal grpc_operation, operation
Expand Down

0 comments on commit 96bb087

Please sign in to comment.