From 81563db4b05d8d339ae0f3fa69e9a94313b1e9ae Mon Sep 17 00:00:00 2001 From: balasubramanian-s Date: Thu, 29 Aug 2024 17:46:44 +0530 Subject: [PATCH] rename resource name Signed-off-by: balasubramanian-s --- ...d => google_apigee_endpoint_attachment.md} | 18 +++--- .../google_apigee_endpoint_attachments.md | 58 +++++++++++++++++++ ...pigee_organization_endpoint_attachments.md | 58 ------------------- ...b => google_apigee_endpoint_attachment.rb} | 10 ++-- ... => google_apigee_endpoint_attachments.rb} | 10 ++-- .../google_apigee_endpoint_attachment.rb | 46 +++++++++++++++ ... => google_apigee_endpoint_attachments.rb} | 12 ++-- ...apigee_organization_endpoint_attachment.rb | 46 --------------- 8 files changed, 129 insertions(+), 129 deletions(-) rename docs/resources/{google_apigee_organization_endpoint_attachment.md => google_apigee_endpoint_attachment.md} (66%) create mode 100644 docs/resources/google_apigee_endpoint_attachments.md delete mode 100644 docs/resources/google_apigee_organization_endpoint_attachments.md rename libraries/{google_apigee_organization_endpoint_attachment.rb => google_apigee_endpoint_attachment.rb} (87%) rename libraries/{google_apigee_organization_endpoint_attachments.rb => google_apigee_endpoint_attachments.rb} (90%) create mode 100644 test/integration/verify/controls/google_apigee_endpoint_attachment.rb rename test/integration/verify/controls/{google_apigee_organization_endpoint_attachments.rb => google_apigee_endpoint_attachments.rb} (69%) delete mode 100644 test/integration/verify/controls/google_apigee_organization_endpoint_attachment.rb diff --git a/docs/resources/google_apigee_organization_endpoint_attachment.md b/docs/resources/google_apigee_endpoint_attachment.md similarity index 66% rename from docs/resources/google_apigee_organization_endpoint_attachment.md rename to docs/resources/google_apigee_endpoint_attachment.md index d4a2ab3d..527be5c0 100644 --- a/docs/resources/google_apigee_organization_endpoint_attachment.md +++ b/docs/resources/google_apigee_endpoint_attachment.md @@ -1,6 +1,6 @@ +++ -title = "google_apigee_organization_endpoint_attachment Resource" +title = "google_apigee_endpoint_attachment Resource" platform = "gcp" draft = false gh_repo = "inspec-gcp" @@ -8,22 +8,22 @@ gh_repo = "inspec-gcp" [menu.inspec] -title = "google_apigee_organization_endpoint_attachment" -identifier = "inspec/resources/gcp/google_apigee_organization_endpoint_attachment Resource" +title = "google_apigee_endpoint_attachment" +identifier = "inspec/resources/gcp/google_apigee_endpoint_attachment Resource" parent = "inspec/resources/gcp" +++ -Use the `google_apigee_organization_endpoint_attachment` InSpec audit resource to test the properties of a test a Google OrganizationEndpointAttachment. +Use the `google_apigee_endpoint_attachment` InSpec audit resource to test the properties of a test a Google EndpointAttachment. ## Installation {{% inspec_gcp_install %}} ## Syntax -A `google_apigee_organization_endpoint_attachment` is used to test a Google OrganizationEndpointAttachment resource +A `google_apigee_endpoint_attachment` is used to test a Google EndpointAttachment resource ## Examples ``` -describe google_apigee_organization_endpoint_attachment(name: ' value_name') do +describe google_apigee_endpoint_attachment(name: ' value_name') do it { should exist } its('host') { should cmp 'value_host' } its('connection_state') { should cmp 'value_connectionstate' } @@ -34,16 +34,16 @@ describe google_apigee_organization_endpoint_attachment(name: ' value_name') do end -describe google_apigee_organization_endpoint_attachment(name: "does_not_exit") do +describe google_apigee_endpoint_attachment(name: "does_not_exit") do it { should_not exist } end ``` ## Parameters -Properties that can be accessed from the `google_apigee_organization_endpoint_attachment` resource: +Properties that can be accessed from the `google_apigee_endpoint_attachment` resource: ## Properties -Properties that can be accessed from the `google_apigee_organization_endpoint_attachment` resource: +Properties that can be accessed from the `google_apigee_endpoint_attachment` resource: * `host`: Output only. Host that can be used in either the HTTP target endpoint directly or as the host in target server. diff --git a/docs/resources/google_apigee_endpoint_attachments.md b/docs/resources/google_apigee_endpoint_attachments.md new file mode 100644 index 00000000..a157f393 --- /dev/null +++ b/docs/resources/google_apigee_endpoint_attachments.md @@ -0,0 +1,58 @@ ++++ + +title = "google_apigee_endpoint_attachments Resource" +platform = "gcp" +draft = false +gh_repo = "inspec-gcp" + + +[menu.inspec] + +title = "google_apigee_endpoint_attachments" +identifier = "inspec/resources/gcp/google_apigee_endpoint_attachments Resource" +parent = "inspec/resources/gcp" ++++ + +Use the `google_apigee_endpoint_attachments` InSpec audit resource to test the properties of a test a Google EndpointAttachment. + +## Installation +{{% inspec_gcp_install %}} + +## Syntax +A `google_apigee_endpoint_attachments` is used to test a Google EndpointAttachment resource + +## Examples +``` + describe google_apigee_endpoint_attachments() do + it { should exist } + end +``` + +## Parameters +Properties that can be accessed from the `google_apigee_endpoint_attachments` resource: + +See [google_apigee_endpoint_attachment.md](google_apigee_endpoint_attachment.md) for more detailed information +* `hosts`: an array of `google_apigee_endpoint_attachment` host +* `connection_states`: an array of `google_apigee_endpoint_attachment` connection_state +* `service_attachments`: an array of `google_apigee_endpoint_attachment` service_attachment +* `locations`: an array of `google_apigee_endpoint_attachment` location +* `names`: an array of `google_apigee_endpoint_attachment` name +* `states`: an array of `google_apigee_endpoint_attachment` state +## Properties +Properties that can be accessed from the `google_apigee_endpoint_attachments` resource: + +See [google_apigee_endpoint_attachment.md](google_apigee_endpoint_attachment.md) for more detailed information +* `hosts`: an array of `google_apigee_endpoint_attachment` host +* `connection_states`: an array of `google_apigee_endpoint_attachment` connection_state +* `service_attachments`: an array of `google_apigee_endpoint_attachment` service_attachment +* `locations`: an array of `google_apigee_endpoint_attachment` location +* `names`: an array of `google_apigee_endpoint_attachment` name +* `states`: an array of `google_apigee_endpoint_attachment` state + +## Filter Criteria +This resource supports all of the above properties as filter criteria, which can be used +with `where` as a block or a method. + +## GCP Permissions + +Ensure the [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project. diff --git a/docs/resources/google_apigee_organization_endpoint_attachments.md b/docs/resources/google_apigee_organization_endpoint_attachments.md deleted file mode 100644 index 486bdaa7..00000000 --- a/docs/resources/google_apigee_organization_endpoint_attachments.md +++ /dev/null @@ -1,58 +0,0 @@ -+++ - -title = "google_apigee_organization_endpoint_attachments Resource" -platform = "gcp" -draft = false -gh_repo = "inspec-gcp" - - -[menu.inspec] - -title = "google_apigee_organization_endpoint_attachments" -identifier = "inspec/resources/gcp/google_apigee_organization_endpoint_attachments Resource" -parent = "inspec/resources/gcp" -+++ - -Use the `google_apigee_organization_endpoint_attachments` InSpec audit resource to test the properties of a test a Google OrganizationEndpointAttachment. - -## Installation -{{% inspec_gcp_install %}} - -## Syntax -A `google_apigee_organization_endpoint_attachments` is used to test a Google OrganizationEndpointAttachment resource - -## Examples -``` - describe google_apigee_organization_endpoint_attachments() do - it { should exist } - end -``` - -## Parameters -Properties that can be accessed from the `google_apigee_organization_endpoint_attachments` resource: - -See [google_apigee_organization_endpoint_attachment.md](google_apigee_organization_endpoint_attachment.md) for more detailed information -* `hosts`: an array of `google_apigee_organization_endpoint_attachment` host -* `connection_states`: an array of `google_apigee_organization_endpoint_attachment` connection_state -* `service_attachments`: an array of `google_apigee_organization_endpoint_attachment` service_attachment -* `locations`: an array of `google_apigee_organization_endpoint_attachment` location -* `names`: an array of `google_apigee_organization_endpoint_attachment` name -* `states`: an array of `google_apigee_organization_endpoint_attachment` state -## Properties -Properties that can be accessed from the `google_apigee_organization_endpoint_attachments` resource: - -See [google_apigee_organization_endpoint_attachment.md](google_apigee_organization_endpoint_attachment.md) for more detailed information -* `hosts`: an array of `google_apigee_organization_endpoint_attachment` host -* `connection_states`: an array of `google_apigee_organization_endpoint_attachment` connection_state -* `service_attachments`: an array of `google_apigee_organization_endpoint_attachment` service_attachment -* `locations`: an array of `google_apigee_organization_endpoint_attachment` location -* `names`: an array of `google_apigee_organization_endpoint_attachment` name -* `states`: an array of `google_apigee_organization_endpoint_attachment` state - -## Filter Criteria -This resource supports all of the above properties as filter criteria, which can be used -with `where` as a block or a method. - -## GCP Permissions - -Ensure the [Apigee API](https://console.cloud.google.com/apis/library/apigee.googleapis.com/) is enabled for the current project. diff --git a/libraries/google_apigee_organization_endpoint_attachment.rb b/libraries/google_apigee_endpoint_attachment.rb similarity index 87% rename from libraries/google_apigee_organization_endpoint_attachment.rb rename to libraries/google_apigee_endpoint_attachment.rb index 4b524a5a..715dba80 100644 --- a/libraries/google_apigee_organization_endpoint_attachment.rb +++ b/libraries/google_apigee_endpoint_attachment.rb @@ -16,9 +16,9 @@ require 'gcp_backend' # A provider to manage Apigee resources. -class ApigeeOrganizationEndpointAttachment < GcpResourceBase - name 'google_apigee_organization_endpoint_attachment' - desc 'OrganizationEndpointAttachment' +class ApigeeEndpointAttachment < GcpResourceBase + name 'google_apigee_endpoint_attachment' + desc 'EndpointAttachment' supports platform: 'gcp' attr_reader :params @@ -50,7 +50,7 @@ def exists? end def to_s - "OrganizationEndpointAttachment #{@params[:name]}" + "EndpointAttachment #{@params[:name]}" end private @@ -60,6 +60,6 @@ def product_url(_ = nil) end def resource_base_url - '{{+name}}' + '{{name}}' end end diff --git a/libraries/google_apigee_organization_endpoint_attachments.rb b/libraries/google_apigee_endpoint_attachments.rb similarity index 90% rename from libraries/google_apigee_organization_endpoint_attachments.rb rename to libraries/google_apigee_endpoint_attachments.rb index a1c72aa1..6ab7a110 100644 --- a/libraries/google_apigee_organization_endpoint_attachments.rb +++ b/libraries/google_apigee_endpoint_attachments.rb @@ -14,9 +14,9 @@ # # ---------------------------------------------------------------------------- require 'gcp_backend' -class ApigeeOrganizationEndpointAttachments < GcpResourceBase - name 'google_apigee_organization_endpoint_attachments' - desc 'OrganizationEndpointAttachment plural resource' +class ApigeeEndpointAttachments < GcpResourceBase + name 'google_apigee_endpoint_attachments' + desc 'EndpointAttachment plural resource' supports platform: 'gcp' attr_reader :table @@ -35,7 +35,7 @@ class ApigeeOrganizationEndpointAttachments < GcpResourceBase def initialize(params = {}) super(params.merge({ use_http_transport: true })) @params = params - @table = fetch_wrapped_resource('organizationEndpointAttachments') + @table = fetch_wrapped_resource('endpointAttachments') end def fetch_wrapped_resource(wrap_path) @@ -84,6 +84,6 @@ def product_url(_ = nil) end def resource_base_url - '{{+parent}}/endpointAttachments' + '{{parent}}/endpointAttachments' end end diff --git a/test/integration/verify/controls/google_apigee_endpoint_attachment.rb b/test/integration/verify/controls/google_apigee_endpoint_attachment.rb new file mode 100644 index 00000000..245d27ae --- /dev/null +++ b/test/integration/verify/controls/google_apigee_endpoint_attachment.rb @@ -0,0 +1,46 @@ +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** Type: MMv1 *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file in README.md and +# CONTRIBUTING.md located at the root of this package. +# +# ---------------------------------------------------------------------------- + +title 'Test GCP google_apigee_endpoint_attachment resource.' + +gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') + + endpoint_attachment = input('endpoint_attachment', value: { + "name": "value_name", + "parent": "value_parent", + "host": "value_host", + "connection_state": "value_connectionstate", + "service_attachment": "value_serviceattachment", + "location": "value_location", + "state": "value_state" +}, description: 'endpoint_attachment description') +control 'google_apigee_endpoint_attachment-1.0' do + impact 1.0 + title 'google_apigee_endpoint_attachment resource test' + + describe google_apigee_endpoint_attachment(name: endpoint_attachment['name']) do + it { should exist } + its('host') { should cmp endpoint_attachment['host'] } + its('connection_state') { should cmp endpoint_attachment['connection_state'] } + its('service_attachment') { should cmp endpoint_attachment['service_attachment'] } + its('location') { should cmp endpoint_attachment['location'] } + its('name') { should cmp endpoint_attachment['name'] } + its('state') { should cmp endpoint_attachment['state'] } + + end + + describe google_apigee_endpoint_attachment(name: "does_not_exit") do + it { should_not exist } + end +end diff --git a/test/integration/verify/controls/google_apigee_organization_endpoint_attachments.rb b/test/integration/verify/controls/google_apigee_endpoint_attachments.rb similarity index 69% rename from test/integration/verify/controls/google_apigee_organization_endpoint_attachments.rb rename to test/integration/verify/controls/google_apigee_endpoint_attachments.rb index c8ebdc9b..b15e2fcd 100644 --- a/test/integration/verify/controls/google_apigee_organization_endpoint_attachments.rb +++ b/test/integration/verify/controls/google_apigee_endpoint_attachments.rb @@ -12,11 +12,11 @@ # # ---------------------------------------------------------------------------- -title 'Test GCP google_apigee_organization_endpoint_attachments resource.' +title 'Test GCP google_apigee_endpoint_attachments resource.' gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - organization_endpoint_attachment = input('organization_endpoint_attachment', value: { + endpoint_attachment = input('endpoint_attachment', value: { "name": "value_name", "parent": "value_parent", "host": "value_host", @@ -24,12 +24,12 @@ "service_attachment": "value_serviceattachment", "location": "value_location", "state": "value_state" -}, description: 'organization_endpoint_attachment description') -control 'google_apigee_organization_endpoint_attachments-1.0' do +}, description: 'endpoint_attachment description') +control 'google_apigee_endpoint_attachments-1.0' do impact 1.0 - title 'google_apigee_organization_endpoint_attachments resource test' + title 'google_apigee_endpoint_attachments resource test' - describe google_apigee_organization_endpoint_attachments() do + describe google_apigee_endpoint_attachments() do it { should exist } end end diff --git a/test/integration/verify/controls/google_apigee_organization_endpoint_attachment.rb b/test/integration/verify/controls/google_apigee_organization_endpoint_attachment.rb deleted file mode 100644 index 01bafb1b..00000000 --- a/test/integration/verify/controls/google_apigee_organization_endpoint_attachment.rb +++ /dev/null @@ -1,46 +0,0 @@ -# ---------------------------------------------------------------------------- -# -# *** AUTO GENERATED CODE *** Type: MMv1 *** -# -# ---------------------------------------------------------------------------- -# -# This file is automatically generated by Magic Modules and manual -# changes will be clobbered when the file is regenerated. -# -# Please read more about how to change this file in README.md and -# CONTRIBUTING.md located at the root of this package. -# -# ---------------------------------------------------------------------------- - -title 'Test GCP google_apigee_organization_endpoint_attachment resource.' - -gcp_project_id = input(:gcp_project_id, value: 'gcp_project_id', description: 'The GCP project identifier.') - - organization_endpoint_attachment = input('organization_endpoint_attachment', value: { - "name": "value_name", - "parent": "value_parent", - "host": "value_host", - "connection_state": "value_connectionstate", - "service_attachment": "value_serviceattachment", - "location": "value_location", - "state": "value_state" -}, description: 'organization_endpoint_attachment description') -control 'google_apigee_organization_endpoint_attachment-1.0' do - impact 1.0 - title 'google_apigee_organization_endpoint_attachment resource test' - - describe google_apigee_organization_endpoint_attachment(name: organization_endpoint_attachment['name']) do - it { should exist } - its('host') { should cmp organization_endpoint_attachment['host'] } - its('connection_state') { should cmp organization_endpoint_attachment['connection_state'] } - its('service_attachment') { should cmp organization_endpoint_attachment['service_attachment'] } - its('location') { should cmp organization_endpoint_attachment['location'] } - its('name') { should cmp organization_endpoint_attachment['name'] } - its('state') { should cmp organization_endpoint_attachment['state'] } - - end - - describe google_apigee_organization_endpoint_attachment(name: "does_not_exit") do - it { should_not exist } - end -end