Skip to content

Commit

Permalink
Merge pull request #199 from inspec/CHEF-7211-MAGIC-MODULE-compute_v1…
Browse files Browse the repository at this point in the history
…-TargetVpnGateway

CHEF-7211-MAGIC-MODULE-compute_v1-TargetVpnGateway - Resource Implementation
  • Loading branch information
sa-progress authored Nov 26, 2024
2 parents 158b2d1 + f8f1cd6 commit 896f8cd
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 7 deletions.
111 changes: 104 additions & 7 deletions mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24833,6 +24833,103 @@ objects:



- !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.




- !ruby/object:Api::Resource
name: RegionSslPolicy
base_url: 'projects/{{project}}/regions/{{region}}/sslPolicies'
Expand Down Expand Up @@ -24861,7 +24958,7 @@ objects:
description: |-
Represents an SSL Policy resource. Use SSL policies to control SSL features, such as versions and cipher suites, that are offered by Application Load Balancers and proxy Network Load Balancers. For more information, read SSL policies overview.
properties:

- !ruby/object:Api::Type::String
name: 'kind'
description: |
Expand Down Expand Up @@ -24967,7 +25064,7 @@ objects:
- !ruby/object:Api::Type::Array
name: 'data'
description: |
[Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
[Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
Expand All @@ -24986,7 +25083,7 @@ objects:
- !ruby/object:Api::Type::Enum
name: 'tlsMode'
description: |
Indicates whether connections should be secured using TLS. The value of this field determines how TLS is enforced. This field can be set to one of the following: - SIMPLE Secure connections with standard TLS semantics. - MUTUAL Secure connections to the backends using mutual TLS by presenting client certificates for authentication.
Indicates whether connections should be secured using TLS. The value of this field determines how TLS is enforced. This field can be set to one of the following: - SIMPLE Secure connections with standard TLS semantics. - MUTUAL Secure connections to the backends using mutual TLS by presenting client certificates for authentication.
values:
- :INVALID
- :MUTUAL
Expand Down Expand Up @@ -25183,7 +25280,7 @@ objects:




- !ruby/object:Api::Resource
name: RegionSslPolicy
base_url: 'projects/{{project}}/regions/{{region}}/sslPolicies'
Expand Down Expand Up @@ -25212,7 +25309,7 @@ objects:
description: |-
Represents an SSL Policy resource. Use SSL policies to control SSL features, such as versions and cipher suites, that are offered by Application Load Balancers and proxy Network Load Balancers. For more information, read SSL policies overview.
properties:

- !ruby/object:Api::Type::String
name: 'kind'
description: |
Expand Down Expand Up @@ -25318,7 +25415,7 @@ objects:
- !ruby/object:Api::Type::Array
name: 'data'
description: |
[Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
[Output Only] Metadata about this warning in key: value format. For example: "data": [ { "key": "scope", "value": "zones/us-east1-d" }
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::String
Expand All @@ -25337,7 +25434,7 @@ objects:
- !ruby/object:Api::Type::Enum
name: 'tlsMode'
description: |
Indicates whether connections should be secured using TLS. The value of this field determines how TLS is enforced. This field can be set to one of the following: - SIMPLE Secure connections with standard TLS semantics. - MUTUAL Secure connections to the backends using mutual TLS by presenting client certificates for authentication.
Indicates whether connections should be secured using TLS. The value of this field determines how TLS is enforced. This field can be set to one of the following: - SIMPLE Secure connections with standard TLS semantics. - MUTUAL Secure connections to the backends using mutual TLS by presenting client certificates for authentication.
values:
- :INVALID
- :MUTUAL
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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')
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,19 @@ region_disk_type:
zone : "value_zone"
self_link : "value_selflink"
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"
region_ssl_policy:
commitment : "value_commitment"
project : "value_project"
Expand Down

0 comments on commit 896f8cd

Please sign in to comment.