From 7c52ecd299d7140d558eba74a3fae2059ea77d72 Mon Sep 17 00:00:00 2001 From: Samir <85890442+sa-progress@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:48:07 +0530 Subject: [PATCH] Automatically generated by magic modules for service: compute_v1 and resource: RegionDiskType. This commit includes the following changes: - Singular Resource ERB File - Plural Resource ERB File - Terraform configuration - api.yaml configuration for product compute_v1 and resource RegionDiskType Signed-off-by: Samir <85890442+sa-progress@users.noreply.github.com> --- mmv1/products/compute/api.yaml | 206 ++++++++++++++++++ .../google_compute_region_disk_type.erb | 20 ++ ...le_compute_region_disk_type_attributes.erb | 3 + .../google_compute_region_disk_types.erb | 5 + .../configuration/mm-attributes.yml | 15 +- 5 files changed, 248 insertions(+), 1 deletion(-) create mode 100644 mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type.erb create mode 100644 mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type_attributes.erb create mode 100644 mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_types.erb diff --git a/mmv1/products/compute/api.yaml b/mmv1/products/compute/api.yaml index 14683ac9e..9467c16a3 100644 --- a/mmv1/products/compute/api.yaml +++ b/mmv1/products/compute/api.yaml @@ -24497,3 +24497,209 @@ objects: description: | [Output Only] Server-defined URL for the resource. + + + + - !ruby/object:Api::Resource + name: RegionDiskType + base_url: 'projects/{{project}}/regions/{{region}}/diskTypes' + self_link: 'projects/{{project}}/regions/{{region}}/diskTypes/{{diskType}}' + references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': + api: 'https://cloud.google.com/compute/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: |- + Represents a Disk Type resource. Google Compute Engine has two Disk Type resources: * [Regional](/compute/docs/reference/rest/v1/regionDiskTypes) * [Zonal](/compute/docs/reference/rest/v1/diskTypes) You can choose from a variety of disk types based on your needs. For more information, read Storage options. The diskTypes resource represents disk types for a zonal persistent disk. For more information, read Zonal persistent disks. The regionDiskTypes resource represents disk types for a regional persistent disk. For more information, read Regional persistent disks. + properties: + + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#diskType for disk types. + - !ruby/object:Api::Type::String + name: 'id' + description: | + [Output Only] The unique identifier for the resource. This identifier is defined by the server. + - !ruby/object:Api::Type::String + name: 'creationTimestamp' + description: | + [Output Only] Creation timestamp in RFC3339 text format. + - !ruby/object:Api::Type::String + name: 'name' + description: | + [Output Only] Name of the resource. + - !ruby/object:Api::Type::String + name: 'description' + description: | + [Output Only] An optional description of this resource. + - !ruby/object:Api::Type::String + name: 'validDiskSize' + description: | + [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + - !ruby/object:Api::Type::NestedObject + name: 'deprecated' + description: | + Deprecation status for a public resource. + properties: + - !ruby/object:Api::Type::Enum + name: 'state' + description: | + The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + values: + - :ACTIVE + - :DELETED + - :DEPRECATED + - :OBSOLETE + - !ruby/object:Api::Type::String + name: 'replacement' + description: | + The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + - !ruby/object:Api::Type::String + name: 'deprecated' + description: | + An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + - !ruby/object:Api::Type::String + name: 'obsolete' + description: | + An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + - !ruby/object:Api::Type::String + name: 'deleted' + description: | + An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + - !ruby/object:Api::Type::String + name: 'zone' + description: | + [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + - !ruby/object:Api::Type::String + name: 'selfLink' + description: | + [Output Only] Server-defined URL for the resource. + - !ruby/object:Api::Type::String + name: 'defaultDiskSizeGb' + description: | + [Output Only] Server-defined default disk size in GB. + - !ruby/object:Api::Type::String + name: 'region' + description: | + [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + + + + + - !ruby/object:Api::Resource + name: RegionDiskType + base_url: 'projects/{{project}}/regions/{{region}}/diskTypes' + self_link: 'projects/{{project}}/regions/{{region}}/diskTypes/{{diskType}}' + references: !ruby/object:Api::Resource::ReferenceLinks + guides: + 'Official Documentation': + api: 'https://cloud.google.com/compute/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: |- + Represents a Disk Type resource. Google Compute Engine has two Disk Type resources: * [Regional](/compute/docs/reference/rest/v1/regionDiskTypes) * [Zonal](/compute/docs/reference/rest/v1/diskTypes) You can choose from a variety of disk types based on your needs. For more information, read Storage options. The diskTypes resource represents disk types for a zonal persistent disk. For more information, read Zonal persistent disks. The regionDiskTypes resource represents disk types for a regional persistent disk. For more information, read Regional persistent disks. + properties: + + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#diskType for disk types. + - !ruby/object:Api::Type::String + name: 'id' + description: | + [Output Only] The unique identifier for the resource. This identifier is defined by the server. + - !ruby/object:Api::Type::String + name: 'creationTimestamp' + description: | + [Output Only] Creation timestamp in RFC3339 text format. + - !ruby/object:Api::Type::String + name: 'name' + description: | + [Output Only] Name of the resource. + - !ruby/object:Api::Type::String + name: 'description' + description: | + [Output Only] An optional description of this resource. + - !ruby/object:Api::Type::String + name: 'validDiskSize' + description: | + [Output Only] An optional textual description of the valid disk size, such as "10GB-10TB". + - !ruby/object:Api::Type::NestedObject + name: 'deprecated' + description: | + Deprecation status for a public resource. + properties: + - !ruby/object:Api::Type::Enum + name: 'state' + description: | + The deprecation state of this resource. This can be ACTIVE, DEPRECATED, OBSOLETE, or DELETED. Operations which communicate the end of life date for an image, can use ACTIVE. Operations which create a new resource using a DEPRECATED resource will return successfully, but with a warning indicating the deprecated resource and recommending its replacement. Operations which use OBSOLETE or DELETED resources will be rejected and result in an error. + values: + - :ACTIVE + - :DELETED + - :DEPRECATED + - :OBSOLETE + - !ruby/object:Api::Type::String + name: 'replacement' + description: | + The URL of the suggested replacement for a deprecated resource. The suggested replacement resource must be the same kind of resource as the deprecated resource. + - !ruby/object:Api::Type::String + name: 'deprecated' + description: | + An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DEPRECATED. This is only informational and the status will not change unless the client explicitly changes it. + - !ruby/object:Api::Type::String + name: 'obsolete' + description: | + An optional RFC3339 timestamp on or after which the state of this resource is intended to change to OBSOLETE. This is only informational and the status will not change unless the client explicitly changes it. + - !ruby/object:Api::Type::String + name: 'deleted' + description: | + An optional RFC3339 timestamp on or after which the state of this resource is intended to change to DELETED. This is only informational and the status will not change unless the client explicitly changes it. + - !ruby/object:Api::Type::String + name: 'zone' + description: | + [Output Only] URL of the zone where the disk type resides. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + - !ruby/object:Api::Type::String + name: 'selfLink' + description: | + [Output Only] Server-defined URL for the resource. + - !ruby/object:Api::Type::String + name: 'defaultDiskSizeGb' + description: | + [Output Only] Server-defined default disk size in GB. + - !ruby/object:Api::Type::String + name: 'region' + description: | + [Output Only] URL of the region where the disk type resides. Only applicable for regional resources. You must specify this field as part of the HTTP request URL. It is not settable as a field in the request body. + diff --git a/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type.erb b/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type.erb new file mode 100644 index 000000000..abd5491ff --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type.erb @@ -0,0 +1,20 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> +<% region_disk_type = grab_attributes(pwd)['region_disk_type'] -%> +describe google_compute_region_disk_type(diskType: <%= doc_generation ? "' #{region_disk_type['diskType']}'":"region_disk_type['diskType']" -%>, project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{region_disk_type['region']}'":"region_disk_type['region']" -%>) do + it { should exist } + its('kind') { should cmp <%= doc_generation ? "'#{region_disk_type['kind']}'" : "region_disk_type['kind']" -%> } + its('id') { should cmp <%= doc_generation ? "'#{region_disk_type['id']}'" : "region_disk_type['id']" -%> } + its('creation_timestamp') { should cmp <%= doc_generation ? "'#{region_disk_type['creation_timestamp']}'" : "region_disk_type['creation_timestamp']" -%> } + its('name') { should cmp <%= doc_generation ? "'#{region_disk_type['name']}'" : "region_disk_type['name']" -%> } + its('description') { should cmp <%= doc_generation ? "'#{region_disk_type['description']}'" : "region_disk_type['description']" -%> } + its('valid_disk_size') { should cmp <%= doc_generation ? "'#{region_disk_type['valid_disk_size']}'" : "region_disk_type['valid_disk_size']" -%> } + its('zone') { should cmp <%= doc_generation ? "'#{region_disk_type['zone']}'" : "region_disk_type['zone']" -%> } + its('self_link') { should cmp <%= doc_generation ? "'#{region_disk_type['self_link']}'" : "region_disk_type['self_link']" -%> } + its('default_disk_size_gb') { should cmp <%= doc_generation ? "'#{region_disk_type['default_disk_size_gb']}'" : "region_disk_type['default_disk_size_gb']" -%> } + its('region') { should cmp <%= doc_generation ? "'#{region_disk_type['region']}'" : "region_disk_type['region']" -%> } + +end + +describe google_compute_region_disk_type(diskType: <%= doc_generation ? "' #{region_disk_type['diskType']}'":"region_disk_type['diskType']" -%>, project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{region_disk_type['region']}'":"region_disk_type['region']" -%>) do + it { should_not exist } +end \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type_attributes.erb b/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type_attributes.erb new file mode 100644 index 000000000..1ec34d856 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_type_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.') + + region_disk_type = input('region_disk_type', value: <%= JSON.pretty_generate(grab_attributes(pwd)['region_disk_type']) -%>, description: 'region_disk_type description') \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_types.erb b/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_types.erb new file mode 100644 index 000000000..637fb68e1 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_region_disk_type/google_compute_region_disk_types.erb @@ -0,0 +1,5 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> + <% region_disk_type = grab_attributes(pwd)['region_disk_type'] -%> + describe google_compute_region_disk_types(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{region_disk_type['region']}'":"region_disk_type['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 bce236ccb..9234dbac9 100644 --- a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml +++ b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml @@ -1091,4 +1091,17 @@ node_type: name : "value_name" description : "value_description" cpu_platform : "value_cpuplatform" - self_link : "value_selflink" \ No newline at end of file + self_link : "value_selflink" +region_disk_type: + disk_type : "value_disktype" + project : "value_project" + region : "value_region" + kind : "value_kind" + id : "value_id" + creation_timestamp : "value_creationtimestamp" + name : "value_name" + description : "value_description" + valid_disk_size : "value_validdisksize" + zone : "value_zone" + self_link : "value_selflink" + default_disk_size_gb : "value_defaultdisksizegb" \ No newline at end of file