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: Job.

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 27, 2024
1 parent c1b108e commit 3d88567
Show file tree
Hide file tree
Showing 43 changed files with 2,584 additions and 0 deletions.
483 changes: 483 additions & 0 deletions docs/resources/google_run_job.md

Large diffs are not rendered by default.

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

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


[menu.inspec]

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

Use the `google_run_jobs` InSpec audit resource to test the properties of a test a Google Job.

## Installation
{{% inspec_gcp_install %}}

## Syntax
A `google_run_jobs` is used to test a Google Job resource

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

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

See [google_run_job.md](google_run_job.md) for more detailed information
* `names`: an array of `google_run_job` name
* `uids`: an array of `google_run_job` uid
* `generations`: an array of `google_run_job` generation
* `labels`: an array of `google_run_job` labels
* `annotations`: an array of `google_run_job` annotations
* `create_times`: an array of `google_run_job` create_time
* `update_times`: an array of `google_run_job` update_time
* `delete_times`: an array of `google_run_job` delete_time
* `expire_times`: an array of `google_run_job` expire_time
* `creators`: an array of `google_run_job` creator
* `last_modifiers`: an array of `google_run_job` last_modifier
* `clients`: an array of `google_run_job` client
* `client_versions`: an array of `google_run_job` client_version
* `launch_stages`: an array of `google_run_job` launch_stage
* `binary_authorizations`: an array of `google_run_job` binary_authorization
* `templates`: an array of `google_run_job` template
* `observed_generations`: an array of `google_run_job` observed_generation
* `terminal_conditions`: an array of `google_run_job` terminal_condition
* `conditions`: an array of `google_run_job` conditions
* `execution_counts`: an array of `google_run_job` execution_count
* `latest_created_executions`: an array of `google_run_job` latest_created_execution
* `reconcilings`: an array of `google_run_job` reconciling
* `satisfies_pzs`: an array of `google_run_job` satisfies_pzs
* `start_execution_tokens`: an array of `google_run_job` start_execution_token
* `run_execution_tokens`: an array of `google_run_job` run_execution_token
* `etags`: an array of `google_run_job` etag
## Properties
Properties that can be accessed from the `google_run_jobs` resource:

See [google_run_job.md](google_run_job.md) for more detailed information
* `names`: an array of `google_run_job` name
* `uids`: an array of `google_run_job` uid
* `generations`: an array of `google_run_job` generation
* `labels`: an array of `google_run_job` labels
* `annotations`: an array of `google_run_job` annotations
* `create_times`: an array of `google_run_job` create_time
* `update_times`: an array of `google_run_job` update_time
* `delete_times`: an array of `google_run_job` delete_time
* `expire_times`: an array of `google_run_job` expire_time
* `creators`: an array of `google_run_job` creator
* `last_modifiers`: an array of `google_run_job` last_modifier
* `clients`: an array of `google_run_job` client
* `client_versions`: an array of `google_run_job` client_version
* `launch_stages`: an array of `google_run_job` launch_stage
* `binary_authorizations`: an array of `google_run_job` binary_authorization
* `templates`: an array of `google_run_job` template
* `observed_generations`: an array of `google_run_job` observed_generation
* `terminal_conditions`: an array of `google_run_job` terminal_condition
* `conditions`: an array of `google_run_job` conditions
* `execution_counts`: an array of `google_run_job` execution_count
* `latest_created_executions`: an array of `google_run_job` latest_created_execution
* `reconcilings`: an array of `google_run_job` reconciling
* `satisfies_pzs`: an array of `google_run_job` satisfies_pzs
* `start_execution_tokens`: an array of `google_run_job` start_execution_token
* `run_execution_tokens`: an array of `google_run_job` run_execution_token
* `etags`: an array of `google_run_job` etag

## 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.
34 changes: 34 additions & 0 deletions libraries/google/run/property/job_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 JobAnnotations
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} JobAnnotations"
end
end
end
end
end
40 changes: 40 additions & 0 deletions libraries/google/run/property/job_binary_authorization.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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 JobBinaryAuthorization
attr_reader :use_default

attr_reader :policy

attr_reader :breakglass_justification

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@use_default = args['useDefault']
@policy = args['policy']
@breakglass_justification = args['breakglassJustification']
end

def to_s
"#{@parent_identifier} JobBinaryAuthorization"
end
end
end
end
end
63 changes: 63 additions & 0 deletions libraries/google/run/property/job_conditions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# 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 JobConditions
attr_reader :type

attr_reader :state

attr_reader :message

attr_reader :last_transition_time

attr_reader :severity

attr_reader :reason

attr_reader :revision_reason

attr_reader :execution_reason

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@type = args['type']
@state = args['state']
@message = args['message']
@last_transition_time = args['lastTransitionTime']
@severity = args['severity']
@reason = args['reason']
@revision_reason = args['revisionReason']
@execution_reason = args['executionReason']
end

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

class JobConditionsArray
def self.parse(value, parent_identifier)
return if value.nil?
return JobConditions.new(value, parent_identifier) unless value.is_a?(::Array)
value.map { |v| JobConditions.new(v, parent_identifier) }
end
end
end
end
end
34 changes: 34 additions & 0 deletions libraries/google/run/property/job_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 JobLabels
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} JobLabels"
end
end
end
end
end
46 changes: 46 additions & 0 deletions libraries/google/run/property/job_latest_created_execution.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.
#
# ----------------------------------------------------------------------------
module GoogleInSpec
module Run
module Property
class JobLatestCreatedExecution
attr_reader :name

attr_reader :create_time

attr_reader :completion_time

attr_reader :delete_time

attr_reader :completion_status

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@name = args['name']
@create_time = args['createTime']
@completion_time = args['completionTime']
@delete_time = args['deleteTime']
@completion_status = args['completionStatus']
end

def to_s
"#{@parent_identifier} JobLatestCreatedExecution"
end
end
end
end
end
53 changes: 53 additions & 0 deletions libraries/google/run/property/job_template.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# 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/job_template_annotations'
require 'google/run/property/job_template_labels'
require 'google/run/property/job_template_template'
require 'google/run/property/job_template_template_containers'
require 'google/run/property/job_template_template_volumes'
require 'google/run/property/job_template_template_vpc_access'
require 'google/run/property/job_template_template_vpc_access_network_interfaces'
module GoogleInSpec
module Run
module Property
class JobTemplate
attr_reader :labels

attr_reader :annotations

attr_reader :parallelism

attr_reader :task_count

attr_reader :template

def initialize(args = nil, parent_identifier = nil)
return if args.nil?
@parent_identifier = parent_identifier
@labels = GoogleInSpec::Run::Property::JobTemplateLabels.new(args['labels'], to_s)
@annotations = GoogleInSpec::Run::Property::JobTemplateAnnotations.new(args['annotations'], to_s)
@parallelism = args['parallelism']
@task_count = args['taskCount']
@template = GoogleInSpec::Run::Property::JobTemplateTemplate.new(args['template'], to_s)
end

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

0 comments on commit 3d88567

Please sign in to comment.