From e77173029fbdb315947b94391841608840c515f0 Mon Sep 17 00:00:00 2001 From: Samir Anand Date: Thu, 23 Nov 2023 20:52:48 +0530 Subject: [PATCH] Automatically generated by magic modules for service: dataproc and resource: Projects__regions__cluster. This commit includes the following changes: - Singular Resource ERB File - Plural Resource ERB File - Terraform configuration - api.yaml configuration for product dataproc and resource Projects__regions__cluster Signed-off-by: Samir Anand --- mmv1/products/dataproc/api.yaml | 150 ++++++++++++++++++ ...google_dataproc_project_region_cluster.erb | 10 ++ ...proc_project_region_cluster_attributes.erb | 3 + ...oogle_dataproc_project_region_clusters.erb | 5 + .../configuration/mm-attributes.yml | 5 + 5 files changed, 173 insertions(+) create mode 100644 mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster.erb create mode 100644 mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster_attributes.erb create mode 100644 mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_clusters.erb diff --git a/mmv1/products/dataproc/api.yaml b/mmv1/products/dataproc/api.yaml index ed575636e..c794c2dcf 100644 --- a/mmv1/products/dataproc/api.yaml +++ b/mmv1/products/dataproc/api.yaml @@ -615,3 +615,153 @@ objects: name: 'realm' description: | The name of the on-cluster Kerberos realm. + + + + - !ruby/object:Api::Resource + name: ProjectRegionCluster + base_url: 'projects/{{projectId}}/regions/{{region}}/clusters' + self_link: 'projects/{{projectId}}/regions/{{region}}/clusters/{{clusterName}}' + references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': + api: 'https://cloud.google.com/dataproc/docs' + async: !ruby/object:Api::OpAsync + operation: !ruby/object:Api::OpAsync::Operation + path: 'name' + base_url: '{op_id}' + wait_ms: 1000 + result: !ruby/object:Api::OpAsync::Result + path: 'response' + resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: 'done' + complete: True + allowed: + - True + - False + error: !ruby/object:Api::OpAsync::Error + path: 'error' + message: 'message' + description: |- + Describes the identifying information, config, and status of a Dataproc cluster + properties: + + - !ruby/object:Api::Type::String + name: 'projectId' + description: | + Required. The Google Cloud Platform project ID that the cluster belongs to. + - !ruby/object:Api::Type::String + name: 'clusterName' + description: | + Required. The cluster name, which must be unique within a project. The name must start with a lowercase letter, and can contain up to 51 lowercase letters, numbers, and hyphens. It cannot end with a hyphen. The name of a deleted cluster can be reused. + - !ruby/object:Api::Type::String + name: 'config' + description: | + Optional. The cluster config for a cluster of Compute Engine Instances. Note that Dataproc may set default values, and values may change when clusters are updated.Exactly one of ClusterConfig or VirtualClusterConfig must be specified. + - !ruby/object:Api::Type::String + name: 'virtualClusterConfig' + description: | + Optional. The virtual cluster config is used when creating a Dataproc cluster that does not directly control the underlying compute resources, for example, when creating a Dataproc-on-GKE cluster (https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). Dataproc may set default values, and values may change when clusters are updated. Exactly one of config or virtual_cluster_config must be specified. + - !ruby/object:Api::Type::NestedObject + name: 'labels' + description: | + Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. + properties: + - !ruby/object:Api::Type::String + name: 'additionalProperties' + description: | + + - !ruby/object:Api::Type::String + name: 'status' + description: | + Output only. Cluster status. + - !ruby/object:Api::Type::Array + name: 'statusHistory' + description: | + Output only. The previous cluster status. + item_type: Api::Type::String + - !ruby/object:Api::Type::String + name: 'clusterUuid' + description: | + Output only. A cluster UUID (Unique Universal Identifier). Dataproc generates this value when it creates the cluster. + - !ruby/object:Api::Type::String + name: 'metrics' + description: | + Output only. Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release. + + + + + - !ruby/object:Api::Resource + name: ProjectRegionCluster + base_url: 'projects/{{projectId}}/regions/{{region}}/clusters' + self_link: 'projects/{{projectId}}/regions/{{region}}/clusters/{{clusterName}}' + references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': + api: 'https://cloud.google.com/dataproc/docs' + async: !ruby/object:Api::OpAsync + operation: !ruby/object:Api::OpAsync::Operation + path: 'name' + base_url: '{op_id}' + wait_ms: 1000 + result: !ruby/object:Api::OpAsync::Result + path: 'response' + resource_inside_response: true + status: !ruby/object:Api::OpAsync::Status + path: 'done' + complete: True + allowed: + - True + - False + error: !ruby/object:Api::OpAsync::Error + path: 'error' + message: 'message' + description: |- + Describes the identifying information, config, and status of a Dataproc cluster + properties: + + - !ruby/object:Api::Type::String + name: 'projectId' + description: | + Required. The Google Cloud Platform project ID that the cluster belongs to. + - !ruby/object:Api::Type::String + name: 'clusterName' + description: | + Required. The cluster name, which must be unique within a project. The name must start with a lowercase letter, and can contain up to 51 lowercase letters, numbers, and hyphens. It cannot end with a hyphen. The name of a deleted cluster can be reused. + - !ruby/object:Api::Type::String + name: 'config' + description: | + Optional. The cluster config for a cluster of Compute Engine Instances. Note that Dataproc may set default values, and values may change when clusters are updated.Exactly one of ClusterConfig or VirtualClusterConfig must be specified. + - !ruby/object:Api::Type::String + name: 'virtualClusterConfig' + description: | + Optional. The virtual cluster config is used when creating a Dataproc cluster that does not directly control the underlying compute resources, for example, when creating a Dataproc-on-GKE cluster (https://cloud.google.com/dataproc/docs/guides/dpgke/dataproc-gke-overview). Dataproc may set default values, and values may change when clusters are updated. Exactly one of config or virtual_cluster_config must be specified. + - !ruby/object:Api::Type::NestedObject + name: 'labels' + description: | + Optional. The labels to associate with this cluster. Label keys must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, but, if present, must contain 1 to 63 characters, and must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 labels can be associated with a cluster. + properties: + - !ruby/object:Api::Type::String + name: 'additionalProperties' + description: | + + - !ruby/object:Api::Type::String + name: 'status' + description: | + Output only. Cluster status. + - !ruby/object:Api::Type::Array + name: 'statusHistory' + description: | + Output only. The previous cluster status. + item_type: Api::Type::String + - !ruby/object:Api::Type::String + name: 'clusterUuid' + description: | + Output only. A cluster UUID (Unique Universal Identifier). Dataproc generates this value when it creates the cluster. + - !ruby/object:Api::Type::String + name: 'metrics' + description: | + Output only. Contains cluster daemon metrics such as HDFS and YARN stats.Beta Feature: This report is available for testing purposes only. It may be changed before final release. + diff --git a/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster.erb b/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster.erb new file mode 100644 index 000000000..f7321c672 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster.erb @@ -0,0 +1,10 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> +<% project_region_cluster = grab_attributes(pwd)['project_region_cluster'] -%> +describe google_dataproc_project_region_cluster(clusterName: <%= doc_generation ? "' #{project_region_cluster['clusterName']}'":"project_region_cluster['clusterName']" -%>, projectId: <%= doc_generation ? "' #{project_region_cluster['projectId']}'":"project_region_cluster['projectId']" -%>, region: <%= doc_generation ? "' #{project_region_cluster['region']}'":"project_region_cluster['region']" -%>) do + it { should exist } + +end + +describe google_dataproc_project_region_cluster(clusterName: <%= doc_generation ? "' #{project_region_cluster['clusterName']}'":"project_region_cluster['clusterName']" -%>, projectId: <%= doc_generation ? "' #{project_region_cluster['projectId']}'":"project_region_cluster['projectId']" -%>, region: <%= doc_generation ? "' #{project_region_cluster['region']}'":"project_region_cluster['region']" -%>) do + it { should_not exist } +end \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster_attributes.erb b/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster_attributes.erb new file mode 100644 index 000000000..eabebc0fd --- /dev/null +++ b/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_cluster_attributes.erb @@ -0,0 +1,3 @@ +gcp_project_id = input(:gcp_project_id, value: '<%= external_attribute(pwd, 'gcp_project_id') -%>', description: 'The GCP project identifier.') + + project_region_cluster = input('project_region_cluster', value: <%= JSON.pretty_generate(grab_attributes(pwd)['project_region_cluster']) -%>, description: 'project_region_cluster description') \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_clusters.erb b/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_clusters.erb new file mode 100644 index 000000000..615efbb58 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_dataproc_project_region_cluster/google_dataproc_project_region_clusters.erb @@ -0,0 +1,5 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> + <% project_region_cluster = grab_attributes(pwd)['project_region_cluster'] -%> + describe google_dataproc_project_region_clusters(projectId: <%= doc_generation ? "' #{project_region_cluster['projectId']}'":"project_region_cluster['projectId']" -%>, region: <%= doc_generation ? "' #{project_region_cluster['region']}'":"project_region_cluster['region']" -%>) do + it { should exist } + end \ No newline at end of file diff --git a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml index f56a9288a..33e81604d 100644 --- a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml +++ b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml @@ -880,3 +880,8 @@ tensorboard_experiment_run_time_series_resource: update_time : "value_updatetime" create_time : "value_createtime" value_type : "value_valuetype" + +project_region_cluster: + cluster_name : "value_clustername" + project_id : "value_projectid" + region : "value_region" \ No newline at end of file