diff --git a/mmv1/products/compute/api.yaml b/mmv1/products/compute/api.yaml index b96ae5dd4..02e08b0de 100644 --- a/mmv1/products/compute/api.yaml +++ b/mmv1/products/compute/api.yaml @@ -19799,3 +19799,121 @@ objects: description: | This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false. + + + + - !ruby/object:Api::Resource + name: ServiceAttachment + base_url: 'projects/{{project}}/regions/{{region}}/serviceAttachments' + self_link: 'projects/{{project}}/regions/{{region}}/serviceAttachments/{{serviceAttachment}}' + 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 ServiceAttachment resource. A service attachment represents a service that a producer has exposed. It encapsulates the load balancer which fronts the service runs and a list of NAT IP ranges that the producers uses to represent the consumers connecting to the service. + properties: + + - !ruby/object:Api::Type::String + name: 'kind' + description: | + [Output Only] Type of the resource. Always compute#serviceAttachment for service attachments. + - !ruby/object:Api::Type::String + name: 'id' + description: | + [Output Only] The unique identifier for the resource type. The server generates this identifier. + - !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: 'selfLink' + description: | + [Output Only] Server-defined URL for the resource. + - !ruby/object:Api::Type::String + name: 'region' + description: | + [Output Only] URL of the region where the service attachment resides. This field applies only to the region resource. 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: 'producerForwardingRule' + description: | + The URL of a forwarding rule with loadBalancingScheme INTERNAL* that is serving the endpoint identified by this service attachment. + - !ruby/object:Api::Type::String + name: 'targetService' + description: | + The URL of a service serving the endpoint identified by this service attachment. + - !ruby/object:Api::Type::Enum + name: 'connectionPreference' + description: | + The connection preference of service attachment. The value can be set to ACCEPT_AUTOMATIC. An ACCEPT_AUTOMATIC service attachment is one that always accepts the connection from consumer forwarding rules. + values: + - :ACCEPT_AUTOMATIC + - :ACCEPT_MANUAL + - :CONNECTION_PREFERENCE_UNSPECIFIED + - !ruby/object:Api::Type::Array + name: 'connectedEndpoints' + description: | + [Output Only] An array of connections for all the consumers connected to this service attachment. + item_type: Api::Type::String + - !ruby/object:Api::Type::Array + name: 'natSubnets' + description: | + An array of URLs where each entry is the URL of a subnet provided by the service producer to use for NAT in this service attachment. + item_type: Api::Type::String + - !ruby/object:Api::Type::Boolean + name: 'enableProxyProtocol' + description: | + If true, enable the proxy protocol which is for supplying client TCP/IP address data in TCP connections that traverse proxies on their way to destination servers. + - !ruby/object:Api::Type::Array + name: 'consumerRejectLists' + description: | + Projects that are not allowed to connect to this service attachment. The project can be specified using its id or number. + item_type: Api::Type::String + - !ruby/object:Api::Type::Array + name: 'consumerAcceptLists' + description: | + Projects that are allowed to connect to this service attachment. + item_type: Api::Type::String + - !ruby/object:Api::Type::String + name: 'pscServiceAttachmentId' + description: | + [Output Only] An 128-bit global unique ID of the PSC service attachment. + - !ruby/object:Api::Type::String + name: 'fingerprint' + description: | + Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a ServiceAttachment. An up-to-date fingerprint must be provided in order to patch/update the ServiceAttachment; otherwise, the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve the ServiceAttachment. + - !ruby/object:Api::Type::Array + name: 'domainNames' + description: | + If specified, the domain name will be used during the integration between the PSC connected endpoints and the Cloud DNS. For example, this is a valid domain name: "p.mycompany.com.". Current max number of domain names supported is 1. + item_type: Api::Type::String + - !ruby/object:Api::Type::Boolean + name: 'reconcileConnections' + description: | + This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints. - If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified . - If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list. For newly created service attachment, this boolean defaults to false. + diff --git a/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachment.erb b/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachment.erb new file mode 100644 index 000000000..4763df35a --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachment.erb @@ -0,0 +1,21 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> +<% service_attachment = grab_attributes(pwd)['service_attachment'] -%> +describe google_compute_service_attachment(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{service_attachment['region']}'":"service_attachment['region']" -%>, serviceAttachment: <%= doc_generation ? "' #{service_attachment['serviceAttachment']}'":"service_attachment['serviceAttachment']" -%>) do + it { should exist } + its('kind') { should cmp <%= doc_generation ? "'#{service_attachment['kind']}'" : "service_attachment['kind']" -%> } + its('id') { should cmp <%= doc_generation ? "'#{service_attachment['id']}'" : "service_attachment['id']" -%> } + its('creation_timestamp') { should cmp <%= doc_generation ? "'#{service_attachment['creation_timestamp']}'" : "service_attachment['creation_timestamp']" -%> } + its('name') { should cmp <%= doc_generation ? "'#{service_attachment['name']}'" : "service_attachment['name']" -%> } + its('description') { should cmp <%= doc_generation ? "'#{service_attachment['description']}'" : "service_attachment['description']" -%> } + its('self_link') { should cmp <%= doc_generation ? "'#{service_attachment['self_link']}'" : "service_attachment['self_link']" -%> } + its('region') { should cmp <%= doc_generation ? "'#{service_attachment['region']}'" : "service_attachment['region']" -%> } + its('producer_forwarding_rule') { should cmp <%= doc_generation ? "'#{service_attachment['producer_forwarding_rule']}'" : "service_attachment['producer_forwarding_rule']" -%> } + its('target_service') { should cmp <%= doc_generation ? "'#{service_attachment['target_service']}'" : "service_attachment['target_service']" -%> } + its('connection_preference') { should cmp <%= doc_generation ? "'#{service_attachment['connection_preference']}'" : "service_attachment['connection_preference']" -%> } + its('fingerprint') { should cmp <%= doc_generation ? "'#{service_attachment['fingerprint']}'" : "service_attachment['fingerprint']" -%> } + +end + +describe google_compute_service_attachment(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{service_attachment['region']}'":"service_attachment['region']" -%>, serviceAttachment: <%= doc_generation ? "' #{service_attachment['serviceAttachment']}'":"service_attachment['serviceAttachment']" -%>) do + it { should_not exist } +end \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachment_attributes.erb b/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachment_attributes.erb new file mode 100644 index 000000000..7cb132563 --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachment_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.') + + service_attachment = input('service_attachment', value: <%= JSON.pretty_generate(grab_attributes(pwd)['service_attachment']) -%>, description: 'service_attachment description') \ No newline at end of file diff --git a/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachments.erb b/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachments.erb new file mode 100644 index 000000000..78c6786cb --- /dev/null +++ b/mmv1/templates/inspec/examples/google_compute_service_attachment/google_compute_service_attachments.erb @@ -0,0 +1,5 @@ +<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%> + <% service_attachment = grab_attributes(pwd)['service_attachment'] -%> + describe google_compute_service_attachments(project: <%= gcp_project_id -%>, region: <%= doc_generation ? "' #{service_attachment['region']}'":"service_attachment['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 eab23d3ea..fe42a2c2c 100644 --- a/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml +++ b/mmv1/templates/inspec/tests/integration/configuration/mm-attributes.yml @@ -882,4 +882,18 @@ tensorboard_experiment_run_time_series_resource: value_type : "value_valuetype" project_location_image_version: - parent : "value_parent" \ No newline at end of file + parent : "value_parent" +service_attachment: + project : "value_project" + region : "value_region" + service_attachment : "value_serviceattachment" + kind : "value_kind" + id : "value_id" + creation_timestamp : "value_creationtimestamp" + name : "value_name" + description : "value_description" + self_link : "value_selflink" + producer_forwarding_rule : "value_producerforwardingrule" + target_service : "value_targetservice" + connection_preference : "value_connectionpreference" + fingerprint : "value_fingerprint" \ No newline at end of file