Skip to content

Commit

Permalink
Automatically generated by magic modules for service: run_v2 and reso…
Browse files Browse the repository at this point in the history
…urce: Service.

This commit includes the following changes:
- Singular Resource
- Plural Resource
- Documentation updates
- Terraform configuration
- Integration tests

Signed-off-by: Samir <[email protected]>
  • Loading branch information
sa-progress committed Aug 6, 2024
1 parent 1b5d34d commit c2b753e
Show file tree
Hide file tree
Showing 69 changed files with 3,715 additions and 0 deletions.
526 changes: 526 additions & 0 deletions docs/resources/google_run_service.md

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions docs/resources/google_run_services.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
+++

title = "google_run_services Resource"
platform = "gcp"
draft = false
gh_repo = "inspec-gcp"


[menu.inspec]

title = "google_run_services"
identifier = "inspec/resources/gcp/google_run_services Resource"
parent = "inspec/resources/gcp"
+++

Use the `google_run_services` InSpec audit resource to test the properties of a test a Google Service.

## Installation
{{% inspec_gcp_install %}}

## Syntax
A `google_run_services` is used to test a Google Service resource

## Examples
```
describe google_run_services(parent: ' ') do
it { should exist }
end
```

## Parameters
Properties that can be accessed from the `google_run_services` resource:

See [google_run_service.md](google_run_service.md) for more detailed information
* `api_versions`: an array of `google_run_service` api_version
* `kinds`: an array of `google_run_service` kind
* `metadata`: an array of `google_run_service` metadata
* `specs`: an array of `google_run_service` spec
* `statuses`: an array of `google_run_service` status
## Properties
Properties that can be accessed from the `google_run_services` resource:

See [google_run_service.md](google_run_service.md) for more detailed information
* `api_versions`: an array of `google_run_service` api_version
* `kinds`: an array of `google_run_service` kind
* `metadata`: an array of `google_run_service` metadata
* `specs`: an array of `google_run_service` spec
* `statuses`: an array of `google_run_service` status

## 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 [https://run.googleapis.com/](https://console.cloud.google.com/apis/library/run.googleapis.com/) is enabled for the current project.
79 changes: 79 additions & 0 deletions libraries/google/run/property/service_metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** 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.
#
# ----------------------------------------------------------------------------
require 'google/run/property/service_metadata_annotations'
require 'google/run/property/service_metadata_labels'
require 'google/run/property/service_metadata_owner_references'
module GoogleInSpec
module Run
module Property
class ServiceMetadata
attr_reader :name

attr_reader :generate_name

attr_reader :namespace

attr_reader :self_link

attr_reader :uid

attr_reader :resource_version

attr_reader :generation

attr_reader :creation_timestamp

attr_reader :labels

attr_reader :annotations

attr_reader :owner_references

attr_reader :deletion_timestamp

attr_reader :deletion_grace_period_seconds

attr_reader :finalizers

attr_reader :cluster_name

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@name = args['name']
@generate_name = args['generateName']
@namespace = args['namespace']
@self_link = args['selfLink']
@uid = args['uid']
@resource_version = args['resourceVersion']
@generation = args['generation']
@creation_timestamp = args['creationTimestamp']
@labels = GoogleInSpec::Run::Property::ServiceMetadataLabels.new(args['labels'], to_s)
@annotations = GoogleInSpec::Run::Property::ServiceMetadataAnnotations.new(args['annotations'], to_s)
@owner_references = GoogleInSpec::Run::Property::ServiceMetadataOwnerReferencesArray.parse(args['ownerReferences'], to_s)
@deletion_timestamp = args['deletionTimestamp']
@deletion_grace_period_seconds = args['deletionGracePeriodSeconds']
@finalizers = args['finalizers']
@cluster_name = args['clusterName']
end

def to_s
"#{@parent_identifier} ServiceMetadata"
end
end
end
end
end
34 changes: 34 additions & 0 deletions libraries/google/run/property/service_metadata_annotations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** 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.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Run
module Property
class ServiceMetadataAnnotations
attr_reader :additional_properties

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@additional_properties = args['additionalProperties']
end

def to_s
"#{@parent_identifier} ServiceMetadataAnnotations"
end
end
end
end
end
34 changes: 34 additions & 0 deletions libraries/google/run/property/service_metadata_labels.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** 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.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Run
module Property
class ServiceMetadataLabels
attr_reader :additional_properties

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@additional_properties = args['additionalProperties']
end

def to_s
"#{@parent_identifier} ServiceMetadataLabels"
end
end
end
end
end
57 changes: 57 additions & 0 deletions libraries/google/run/property/service_metadata_owner_references.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** 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.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Run
module Property
class ServiceMetadataOwnerReferences
attr_reader :api_version

attr_reader :kind

attr_reader :name

attr_reader :uid

attr_reader :controller

attr_reader :block_owner_deletion

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@api_version = args['apiVersion']
@kind = args['kind']
@name = args['name']
@uid = args['uid']
@controller = args['controller']
@block_owner_deletion = args['blockOwnerDeletion']
end

def to_s
"#{@parent_identifier} ServiceMetadataOwnerReferences"
end
end

class ServiceMetadataOwnerReferencesArray
def self.parse(value, parent_identifier)
return if value.nil?
return ServiceMetadataOwnerReferences.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| ServiceMetadataOwnerReferences.new(v, parent_identifier) }
end
end
end
end
end
48 changes: 48 additions & 0 deletions libraries/google/run/property/service_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** 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.
#
# ----------------------------------------------------------------------------
require 'google/run/property/service_spec_template'
require 'google/run/property/service_spec_template_metadata'
require 'google/run/property/service_spec_template_metadata_annotations'
require 'google/run/property/service_spec_template_metadata_labels'
require 'google/run/property/service_spec_template_metadata_owner_references'
require 'google/run/property/service_spec_template_spec'
require 'google/run/property/service_spec_template_spec_containers'
require 'google/run/property/service_spec_template_spec_image_pull_secrets'
require 'google/run/property/service_spec_template_spec_node_selector'
require 'google/run/property/service_spec_template_spec_volumes'
require 'google/run/property/service_spec_traffic'
module GoogleInSpec
module Run
module Property
class ServiceSpec
attr_reader :template

attr_reader :traffic

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@template = GoogleInSpec::Run::Property::ServiceSpecTemplate.new(args['template'], to_s)
@traffic = GoogleInSpec::Run::Property::ServiceSpecTrafficArray.parse(args['traffic'], to_s)
end

def to_s
"#{@parent_identifier} ServiceSpec"
end
end
end
end
end
46 changes: 46 additions & 0 deletions libraries/google/run/property/service_spec_template.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# frozen_string_literal: false

# ----------------------------------------------------------------------------
#
# *** 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.
#
# ----------------------------------------------------------------------------
require 'google/run/property/service_spec_template_metadata'
require 'google/run/property/service_spec_template_metadata_annotations'
require 'google/run/property/service_spec_template_metadata_labels'
require 'google/run/property/service_spec_template_metadata_owner_references'
require 'google/run/property/service_spec_template_spec'
require 'google/run/property/service_spec_template_spec_containers'
require 'google/run/property/service_spec_template_spec_image_pull_secrets'
require 'google/run/property/service_spec_template_spec_node_selector'
require 'google/run/property/service_spec_template_spec_volumes'
module GoogleInSpec
module Run
module Property
class ServiceSpecTemplate
attr_reader :metadata

attr_reader :spec

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@metadata = GoogleInSpec::Run::Property::ServiceSpecTemplateMetadata.new(args['metadata'], to_s)
@spec = GoogleInSpec::Run::Property::ServiceSpecTemplateSpec.new(args['spec'], to_s)
end

def to_s
"#{@parent_identifier} ServiceSpecTemplate"
end
end
end
end
end
Loading

0 comments on commit c2b753e

Please sign in to comment.