Skip to content

Commit

Permalink
Automatically generated by magic modules for service: compute_v1 and …
Browse files Browse the repository at this point in the history
…resource: TargetInstance.

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 TargetInstance

Signed-off-by: Samir <[email protected]>
  • Loading branch information
sa-progress committed Mar 26, 2024
1 parent bce9a00 commit b4edef0
Show file tree
Hide file tree
Showing 5 changed files with 213 additions and 1 deletion.
166 changes: 166 additions & 0 deletions mmv1/products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24830,3 +24830,169 @@ objects:
- :FALSE
- :TRUE




- !ruby/object:Api::Resource
name: TargetInstance
base_url: 'projects/{{project}}/zones/{{zone}}/targetInstances'
self_link: 'projects/{{project}}/zones/{{zone}}/targetInstances/{{targetInstance}}'
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 Instance resource. You can use a target instance to handle traffic for one or more forwarding rules, which is ideal for forwarding protocol traffic that is managed by a single source. For example, ESP, AH, TCP, or UDP. For more information, read Target instances.
properties:

- !ruby/object:Api::Type::String
name: 'kind'
description: |
[Output Only] The type of the resource. Always compute#targetInstance for target instances.
- !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: 'zone'
description: |
[Output Only] URL of the zone where the target instance 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::Enum
name: 'natPolicy'
description: |
Must have a value of NO_NAT. Protocol forwarding delivers packets while preserving the destination IP address of the forwarding rule referencing the target instance.
values:
- :NO_NAT
- !ruby/object:Api::Type::String
name: 'instance'
description: |
A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance
- !ruby/object:Api::Type::String
name: 'selfLink'
description: |
[Output Only] Server-defined URL for the resource.
- !ruby/object:Api::Type::String
name: 'selfLinkWithId'
description: |
[Output Only] Server-defined URL for this resource with the resource id.
- !ruby/object:Api::Type::String
name: 'network'
description: |
The URL of the network this target instance uses to forward traffic. If not specified, the traffic will be forwarded to the network that the default network interface belongs to.
- !ruby/object:Api::Type::String
name: 'securityPolicy'
description: |
[Output Only] The resource URL for the security policy associated with this target instance.




- !ruby/object:Api::Resource
name: TargetInstance
base_url: 'projects/{{project}}/zones/{{zone}}/targetInstances'
self_link: 'projects/{{project}}/zones/{{zone}}/targetInstances/{{targetInstance}}'
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 Instance resource. You can use a target instance to handle traffic for one or more forwarding rules, which is ideal for forwarding protocol traffic that is managed by a single source. For example, ESP, AH, TCP, or UDP. For more information, read Target instances.
properties:

- !ruby/object:Api::Type::String
name: 'kind'
description: |
[Output Only] The type of the resource. Always compute#targetInstance for target instances.
- !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: 'zone'
description: |
[Output Only] URL of the zone where the target instance 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::Enum
name: 'natPolicy'
description: |
Must have a value of NO_NAT. Protocol forwarding delivers packets while preserving the destination IP address of the forwarding rule referencing the target instance.
values:
- :NO_NAT
- !ruby/object:Api::Type::String
name: 'instance'
description: |
A URL to the virtual machine instance that handles traffic for this target instance. When creating a target instance, you can provide the fully-qualified URL or a valid partial URL to the desired virtual machine. For example, the following are all valid URLs: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /instances/instance - projects/project/zones/zone/instances/instance - zones/zone/instances/instance
- !ruby/object:Api::Type::String
name: 'selfLink'
description: |
[Output Only] Server-defined URL for the resource.
- !ruby/object:Api::Type::String
name: 'selfLinkWithId'
description: |
[Output Only] Server-defined URL for this resource with the resource id.
- !ruby/object:Api::Type::String
name: 'network'
description: |
The URL of the network this target instance uses to forward traffic. If not specified, the traffic will be forwarded to the network that the default network interface belongs to.
- !ruby/object:Api::Type::String
name: 'securityPolicy'
description: |
[Output Only] The resource URL for the security policy associated with this target instance.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% target_instance = grab_attributes(pwd)['target_instance'] -%>
describe google_compute_target_instance(project: <%= gcp_project_id -%>, targetInstance: <%= doc_generation ? "' #{target_instance['targetInstance']}'":"target_instance['targetInstance']" -%>, zone: <%= doc_generation ? "' #{target_instance['zone']}'":"target_instance['zone']" -%>) do
it { should exist }
its('kind') { should cmp <%= doc_generation ? "'#{target_instance['kind']}'" : "target_instance['kind']" -%> }
its('id') { should cmp <%= doc_generation ? "'#{target_instance['id']}'" : "target_instance['id']" -%> }
its('creation_timestamp') { should cmp <%= doc_generation ? "'#{target_instance['creation_timestamp']}'" : "target_instance['creation_timestamp']" -%> }
its('name') { should cmp <%= doc_generation ? "'#{target_instance['name']}'" : "target_instance['name']" -%> }
its('description') { should cmp <%= doc_generation ? "'#{target_instance['description']}'" : "target_instance['description']" -%> }
its('zone') { should cmp <%= doc_generation ? "'#{target_instance['zone']}'" : "target_instance['zone']" -%> }
its('nat_policy') { should cmp <%= doc_generation ? "'#{target_instance['nat_policy']}'" : "target_instance['nat_policy']" -%> }
its('instance') { should cmp <%= doc_generation ? "'#{target_instance['instance']}'" : "target_instance['instance']" -%> }
its('self_link') { should cmp <%= doc_generation ? "'#{target_instance['self_link']}'" : "target_instance['self_link']" -%> }
its('self_link_with_id') { should cmp <%= doc_generation ? "'#{target_instance['self_link_with_id']}'" : "target_instance['self_link_with_id']" -%> }
its('network') { should cmp <%= doc_generation ? "'#{target_instance['network']}'" : "target_instance['network']" -%> }
its('security_policy') { should cmp <%= doc_generation ? "'#{target_instance['security_policy']}'" : "target_instance['security_policy']" -%> }

end

describe google_compute_target_instance(project: <%= gcp_project_id -%>, targetInstance: <%= doc_generation ? "' #{target_instance['targetInstance']}'":"target_instance['targetInstance']" -%>, zone: <%= doc_generation ? "' #{target_instance['zone']}'":"target_instance['zone']" -%>) 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_instance = input('target_instance', value: <%= JSON.pretty_generate(grab_attributes(pwd)['target_instance']) -%>, description: 'target_instance 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_instance = grab_attributes(pwd)['target_instance'] -%>
describe google_compute_target_instances(project: <%= gcp_project_id -%>, zone: <%= doc_generation ? "' #{target_instance['zone']}'":"target_instance['zone']" -%>) do
it { should exist }
end
Original file line number Diff line number Diff line change
Expand Up @@ -1116,4 +1116,20 @@ region_disk_type:
valid_disk_size : "value_validdisksize"
zone : "value_zone"
self_link : "value_selflink"
default_disk_size_gb : "value_defaultdisksizegb"
default_disk_size_gb : "value_defaultdisksizegb"
target_instance:
project : "value_project"
region : "value_region"
url_map : "value_urlmap"
kind : "value_kind"
id : "value_id"
creation_timestamp : "value_creationtimestamp"
name : "value_name"
description : "value_description"
zone : "value_zone"
nat_policy : "value_natpolicy"
instance : "value_instance"
self_link : "value_selflink"
self_link_with_id : "value_selflinkwithid"
network : "value_network"
security_policy : "value_securitypolicy"

0 comments on commit b4edef0

Please sign in to comment.