From ced26356be626bfc115e704e4fb2bdfec959f0a2 Mon Sep 17 00:00:00 2001 From: Samir <85890442+sa-progress@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:49:43 +0530 Subject: [PATCH] Automatically generated by magic modules for service: compute_v1 and resource: TargetVpnGateway. 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 TargetVpnGateway Signed-off-by: Samir <85890442+sa-progress@users.noreply.github.com> --- mmv1/products/compute/api.yaml | 97 +++++++++++++++++++ .../google_compute_target_vpn_gateway.erb | 20 ++++ ..._compute_target_vpn_gateway_attributes.erb | 3 + .../google_compute_target_vpn_gateways.erb | 5 + .../configuration/mm-attributes.yml | 15 ++- 5 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway.erb create mode 100644 mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway_attributes.erb create mode 100644 mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateways.erb diff --git a/mmv1/products/compute/api.yaml b/mmv1/products/compute/api.yaml index 5819fd086..f341ca710 100644 --- a/mmv1/products/compute/api.yaml +++ b/mmv1/products/compute/api.yaml @@ -24830,3 +24830,100 @@ objects: - :FALSE - :TRUE + + + + - !ruby/object:Api::Resource + name: TargetVpnGateway + base_url: 'projects/{{project}}/regions/{{region}}/targetVpnGateways' + self_link: 'projects/{{project}}/regions/{{region}}/targetVpnGateways/{{targetVpnGateway}}' + 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 Target VPN Gateway resource. The target VPN gateway resource represents a Classic Cloud VPN gateway. For more information, read the the Cloud VPN Overview. + properties: + + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of resource. Always compute#targetVpnGateway for target VPN gateways. + - !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: | + Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + - !ruby/object:Api::Type::String + name: 'description' + description: | + An optional description of this resource. Provide this property when you create the resource. + - !ruby/object:Api::Type::String + name: 'region' + description: | + [Output Only] URL of the region where the target VPN gateway 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: 'network' + description: | + URL of the network to which this VPN gateway is attached. Provided by the client when the VPN gateway is created. + - !ruby/object:Api::Type::Array + name: 'tunnels' + description: | + [Output Only] A list of URLs to VpnTunnel resources. VpnTunnels are created using the compute.vpntunnels.insert method and associated with a VPN gateway. + item_type: Api::Type::String + - !ruby/object:Api::Type::Enum + name: 'status' + description: | + [Output Only] The status of the VPN gateway, which can be one of the following: CREATING, READY, FAILED, or DELETING. + values: + - :CREATING + - :DELETING + - :FAILED + - :READY + - !ruby/object:Api::Type::String + name: 'selfLink' + description: | + [Output Only] Server-defined URL for the resource. + - !ruby/object:Api::Type::Array + name: 'forwardingRules' + description: | + [Output Only] A list of URLs to the ForwardingRule resources. ForwardingRules are created using compute.forwardingRules.insert and associated with a VPN gateway. + item_type: Api::Type::String + - !ruby/object:Api::Type::NestedObject + name: 'labels' + description: | + Labels for this resource. These can only be added or modified by the setLabels method. Each label key/value pair must comply with RFC1035. Label values may be empty. + properties: + - !ruby/object:Api::Type::String + name: 'additionalProperties' + description: | + + - !ruby/object:Api::Type::String + name: 'labelFingerprint' + description: | + A fingerprint for the labels being applied to this TargetVpnGateway, which is essentially a hash of the labels set used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash in order to update or change labels, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a TargetVpnGateway. + diff --git a/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway.erb b/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway.erb new file mode 100644 index 000000000..4bf826f8e --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway.erb @@ -0,0 +1,20 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> +<% target_vpn_gateway = grab_attributes(pwd)['target_vpn_gateway'] -%> +describe google_compute_target_vpn_gateway(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{target_vpn_gateway['region']}'":"target_vpn_gateway['region']" -%>, targetVpnGateway: <%= doc_generation ? "' #{target_vpn_gateway['targetVpnGateway']}'":"target_vpn_gateway['targetVpnGateway']" -%>) do + it { should exist } + its('kind') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['kind']}'" : "target_vpn_gateway['kind']" -%> } + its('id') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['id']}'" : "target_vpn_gateway['id']" -%> } + its('creation_timestamp') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['creation_timestamp']}'" : "target_vpn_gateway['creation_timestamp']" -%> } + its('name') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['name']}'" : "target_vpn_gateway['name']" -%> } + its('description') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['description']}'" : "target_vpn_gateway['description']" -%> } + its('region') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['region']}'" : "target_vpn_gateway['region']" -%> } + its('network') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['network']}'" : "target_vpn_gateway['network']" -%> } + its('status') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['status']}'" : "target_vpn_gateway['status']" -%> } + its('self_link') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['self_link']}'" : "target_vpn_gateway['self_link']" -%> } + its('label_fingerprint') { should cmp <%= doc_generation ? "'#{target_vpn_gateway['label_fingerprint']}'" : "target_vpn_gateway['label_fingerprint']" -%> } + +end + +describe google_compute_target_vpn_gateway(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{target_vpn_gateway['region']}'":"target_vpn_gateway['region']" -%>, targetVpnGateway: <%= doc_generation ? "' #{target_vpn_gateway['targetVpnGateway']}'":"target_vpn_gateway['targetVpnGateway']" -%>) do + it { should_not exist } +end \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway_attributes.erb b/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway_attributes.erb new file mode 100644 index 000000000..543932fda --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateway_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.') + + target_vpn_gateway = input('target_vpn_gateway', value: <%= JSON.pretty_generate(grab_attributes(pwd)['target_vpn_gateway']) -%>, description: 'target_vpn_gateway description') \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateways.erb b/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateways.erb new file mode 100644 index 000000000..7edf443e6 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_target_vpn_gateway/google_compute_target_vpn_gateways.erb @@ -0,0 +1,5 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> + <% target_vpn_gateway = grab_attributes(pwd)['target_vpn_gateway'] -%> + describe google_compute_target_vpn_gateways(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{target_vpn_gateway['region']}'":"target_vpn_gateway['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 e196b7361..43aaa2f9d 100644 --- a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml +++ b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml @@ -1116,4 +1116,17 @@ region_disk_type: valid_disk_size : "value_validdisksize" zone : "value_zone" self_link : "value_selflink" - default_disk_size_gb : "value_defaultdisksizegb" \ No newline at end of file + default_disk_size_gb : "value_defaultdisksizegb" +target_vpn_gateway: + project : "value_project" + region : "value_region" + target_vpn_gateway : "value_targetvpngateway" + kind : "value_kind" + id : "value_id" + creation_timestamp : "value_creationtimestamp" + name : "value_name" + description : "value_description" + network : "value_network" + status : "value_status" + self_link : "value_selflink" + label_fingerprint : "value_labelfingerprint" \ No newline at end of file